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

[no subject]



    HENRY@MIT-AI 04/05/80 23:09:23 Re:  CAR and CDR should send messages
    It's to allow eventual implementation of actors.
    There may want to be user-defined actors which 
    respond specially to CAR and CDR. An example of
    where this would be useful would be in implementing
    a new kind of list which would compute its elements
    incrementally, only when the next element was requested
    (generator or coroutine style). A user program wouldn't
    have to know what kind of list it was dealing with, it
    could just take CAR and CDR.

This is what I said in my original message.
I think this is very poor.

There are all sorts of objects which may be chained together in a list-like
structure, many of which are more complicated than just a cons.  Consider,
for instance, the linking of free chaosnet packets, or the editor's line
objects.  Using CAR and CDR to manipulate these lists would be extremely
confusing.  Higher level naming conventions are used.

My other objection to this proposal deals with syntax.  As long as this
language includes both functional and message passing semantics, there
should be some clear way to distinguish between the two.  And the notation
used for sending messages should be uniform.  If you were writing
(<- X ':CAR), I would object less strongly.  But if you want (CAR X) to send
a message, then all forms which send messages should be written with the
message as the first element of the form.  And messages would have to be
declared appropriately so that the compiler (and people) could distinguish
between the two.

Finally, you should consider transportability.  This is almost impossible to
implement in a system without microcoded CAR, whereas (<- X ':CAR), or
better (<- X ':FIRST), is much easier.