Squeak (ST80) syntax

Jecel Assumpcao Jr. jecel at merlintec.com
Wed Feb 16 18:29:45 UTC 2000


Bob Arning wrote:
> One thing that seems to be overlooked here is that messages in the
> inspector evaluation pane need not be sent to <self>. They can be sent to any
> of the variables listed or to any other known (e.g. global) object. Attempting
> to bias these messages towards self as the receiver could make other messages
> (with <self> as an argument or not referencing <self> at all) harder to enter
> and easier to screw up.

True, which is why this works better in Self. In that language
(http://www.sun.com/research/self for the person who was asking in another
message) you access instance variables, temporaries, arguments, globals and so
on by sending messages to an implicit <self>, so this bias makes perfect sense
for all cases.

I created a language called NeoLogo which had one syntax rule (plus literals):

   <receiver> <selector> <arg1> <arg2> <arg3>...

If the receiver was <self> (actually <currentContext> in the Self tradition,
but let's not go there right now...) then you could either omit it entirely or
write ":". The addition of some ugly precedence rules allowed this language to
be 100% compatible with Logo, which has a much more complex syntax. It was too
ambiguous for my taste, but it did reinforce my impression that the implicit
<self> was nice invention.

The other thing I like about Self's syntax is the use of capital letters for
all but the first keywords:

   Smalltalk:  #between:and
   Self:          'between:And'

This allows you to get away with fewer parenthesis. Here is a bad example:

   Smalltalk:  x between: (0 max: start) and: (100 min: end)
   Self:          x between: (0 max: start) And: 100 min: end

Of course, they had to come up with something like this or replacing assignment
with keyword messages would be impractical.

-- Jecel





More information about the Squeak-dev mailing list