[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Naive T Design Questions



    Date: Thu, 14 Apr 88 20:49:54 EDT
    From: James J. Hunt <jjh at ll-vlsi.arpa>

    1. What is the advantage of having #F and '() not EQ??

In my experience, institutionalizing this pun and makes code harder to
understand.  Having these objects be distinct encourages better type
discipline.

    2. Why isn't BOUND? known to Orbit (especially since *BOUND? exists)?

It shouldn't be known to anyone.  Side effects to environments are
meta-operations; the existence of things like BOUND? in the language (as
opposed to the meta-language) breaks desirable invariants like
order-independence of effectless definitions.

    3. Why was VALUES renamed to RETURN?  RETURN seems to imply change of the
       control flow which return does not do!

Invoking a continuation is a return.  RETURN invokes a continuation.

    4. (This is not a design question.)  Is there a place where T code may be
       deposited for the purpose of making it generally available?  For
       example, I have some code:
    	a version of T3 that runs on SUN-2s,
    	a T version of OPS5 (for whatever that's worth),
    	and a DEFINE-FUNCTION macro that accepts all the Common LISP DEFUN
    		bells and whistles,
       that I would gladly make available if I could (we have no
       anonymous FTP).  In general, I think code sharing amoung T users
       should be encouraged as much as possible so that we are not all
       running around recoding simple tools in T.

There used to be a "T software exchange".  I don't know what became of it.

    5.  Why not include this [Ellisp's IF] in T?

T has COND.

    6. Is this really the best way to implement self evaluating keywords in T:
       (define (read-keyword port ch rt)
         (let ((keyword (read-atom port rt ch)))
           (*lset (the-environment) keyword keyword)))?
       I've tried several things with QUOTE but they all fail in some obscure
       way, and I don't want to touch EVAL and friends!

You could implement keywords as strings or bignums, both of which
self-evaluate, and write your own printer that prints them.  You can
maintain your own table of unique copies so that eq? works.  Another
solution is to use QUOTE, e.g.
  (foo ':bar 3)
instead of
  (foo :bar 3).
Another approach is to do
   (define :bar ':bar)
for each keyword you use.

Actually, in T you can use ordinary symbols instead of keywords, since
you don't have to worry about the vagaries of multiple packages:
   (foo 'bar 3)