[ENH] Help for Adding Name Space to Squeak

Alan Kay Alan.Kay at disney.com
Mon Jul 26 23:21:57 UTC 1999


Stephen --

A good point at the end. The mythical Smalltalk-72 actually could easily
make the distinctions you mentioned (although the receiver always had the
option to decide whether the sender's interpretation should be evaluated --
e.g. the husband could decide whether to evoke what the wife was thinking
when the message was actually sent -- this was similar to but more general
than call by name in that the receiver could decide all about how the
message would be interpreted).

Cheers,

Alan

-------

At 12:12 PM -0800 7/26/99, Stephen Pair wrote:
>Hans-Martin Mosner wrote:
>>
>> Alan Lovejoy wrote:
>>
>> > And Namespaces should also each have their own independent Symbol Table,
>> > so that objects from different Namespaces can interact without
>> possibility of
>> > conflict (Symbols from different Namespaces could then have the same
>> > characters, but still not be ==.  And it works for message
>> selectors, too!).
>>
>> What are the consequences in terms of readability?
>> I always thought that in Smalltalk, the meaning of statically
>> bound identifiers
>> (classes, inst vars, static vars) should be determined in the
>> static scope of the
>> method in which they appear, whereas the meaning of dynamically
>> bound identifiers
>> (message sends) should be determined by the receiver object.
>
>I agree about the readability issue, but message symbols represent an
>implied lookup of a "Message" object that is then sent to the reciever
>(again, in an implied sense, for performance reasons this stuff is optimized
>out).  Given that, does it make sense for the receiver to do the look up of
>this symbol?  The receiver should certainly decide what to do in response to
>the object it receives.
>
>Another point:  Should the generice message sending scheme be so tied to
>symbols (or actually instances of a Message class)?  Or alternatively,
>should we be able to send any object as a message to another object?  For
>instance, we could write:
>
>'Take out the garbage' sentTo: Husband
>
>The receiver could then decide what to do (or do nothing).  In this case, a
>natural language parser might be used to figure out what the intended action
>is and depending on the internal state of the object, decide to actually
>take out the garbage or not.
>
>To accomplish this, we would need to make the message sending scheme
>slightly more generic, allowing any object to be sent as a message to
>another object.
>
>Getting back to the original thought, if we wrote the above message like:
>
>	Husband takeOutGarbage
>
>Shouldn't it be the Wife that determines how the #takeOutGarbage symbol is
>resolved?  Either to a traditional Message, or to the string 'Take out the
>garbage.'  For example, if the Wife sends this message several times within
>a short period of time, she may alter the resolution of #takeOutGarbage such
>that it resolves to 'Take out the garbage!' or 'Get off your lazy *^&#@ and
>take out the gabage!!!'  Variations on the same message, but ones that she
>may have a better chance of getting a response.  :)
>
>- Stephen





More information about the Squeak-dev mailing list