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

Re: Diverse Subjects



    Date:    Tue, 27 Mar 84 08:33:06 EST
    From:    Stanley Letovsky <Letovsky>

    1) Should T objects have default method for handling unknown
    operations? ...

This might be a good idea, but I wonder if it might make the correct
implementation of various potential optimizations such as method caching
more difficult.  Doing this would suddenly make T's operation system
even more unconstrained and hard to understand than it already is.

    3) I notice the meta-circular evaluator in the T manual treats
    apply as primitve. I have taken the li berty of redressing this lack.
    Comments on semantic correctness will be appreciated.
    ...

This merely begs the question of how OBJECT, OPERATION, and JOIN,
which seem to me to be much more complicated than LAMBDA, are
implemented.  The chapter on operations gives an idea of how to do
them in terms of LAMBDA and two primitive procedures.

Object creation must bottom out somewhere, and in T OBJECT is
theoretically sufficient to create everything, including pairs, numbers,
symbols, and closures, so maybe this is the right way to go.  However,
given just two primitive procedures, *OBJECT and GET-HANDLER, LAMBDA
becomes sufficient.  The usual route in meta-circular LISP interpreters
is to take CONS, CAR, and CDR as primitives and implement LAMBDA in
terms of those; you should consider that possibility.

Also note that APPLY could be defined as follows:

    (DEFINE (APPLY PROC L)      ;ignore extended case - you get the idea
      (CASE (LENGTH L)
        ((0) (PROC))
        ((1) (PROC (CAR L)))
        ((2) (PROC (CAR L) (CADR L)))
        ((3) (PROC (CAR L) (CADR L) (CADDR L)))
        ((4) (PROC (CAR L) (CADR L) (CADDR L) (CADDDR L)))
        ...))

if you could manage to fill in the infinite "..." somehow.