[comp.lang.smalltalk] Cascades and Little Smalltalk

budd@mist.CS.ORST.EDU (Tim Budd) (12/13/89)

I don't want to be put in the position of being the defender of Little
Smalltalk - largely because I would probably do a very bad job of it.
(I view it has a tool that served well in it's time - roughly 1984-88, but
it now becoming increasing obsolete).  However I did want to make a comment
on cascades.

The decision to alter the semantics of cascades in Little Smalltalk has a
conscious one.  I have always felt that the necessity to look into the
middle of the expression to the left of the first semicolon in order to
discover the receiver for the message to the right of the semicolon was a
bit bizarre.  The rule in Little Smalltalk is, to my mind, much cleaner.
The receiver for all cascades, and the result of the cascade itself, is
simply the expression to the left of the first semicolon.

In addition to being easier for people to see and understand, this is also
easier for the compiler.

Of course my chances of getting ParcPlace or Digitalk to agree with this
position are reasonably slim.

--tim budd

rich@inmet.inmet.com (12/14/89)

On a related note, can someone who has access to "real" Smalltalk tell me
how the parser compiles a cascaded expression?  With Dr. Budd's Little 
Smalltalk, it just duplicates the result of the last expression.  An annotated
bytecode dump would be fine.

Thanks!

Richard Man
	!uunet!inmet!rich

johnson@p.cs.uiuc.edu (12/17/89)

(X new) msg: y; foo

is the same as

| t |
t := X new.
t msg: y;
t foo

in Smalltalk-80.  Cascades are the only part of the Smalltalk syntax
that can be implemented by other parts without too much trouble.
On the other hand, you usually have to introduce a temporary.  The
definition proposed by Tim Budd only requires a few parenthesis to
replace cascades.  My guess is that this is probably the main reason
that the Smalltalk-80 definition is different from that of Little
Smalltalk.

Ralph Johnson