Cascading ?

ncellier at ifrance.com ncellier at ifrance.com
Thu Aug 17 17:04:33 UTC 2006


Hi tim,
It has nothing to deal with C, but rather with streaming...
Streaming has a natural correspondance with cascading messages.
But in situations when you just want to make code a little bit complex, you are forced to insert variables and make code less readable than would be a simple cascade...
That's the only reason.
Lukas provided a brilliant illustrating example.

Nicolas


Le Jeudi 17 Août 2006 18:49, tim Rowledge a écrit :
> Cascading allows a sequence of message sends to be 'stacked up' for
> sending to the same receiver. If you look at the EBNF spec (as shown
> in the Blue Book) for cascading you will see that it allows for
> receiver
>  message send;
>  message send;
>  ....
> A message send is a *single* message send to receiver and so the
> final 'size negated' in the original example given clearly doesn't
> count. I suspect there is a tendency to allow some C-think to creep
> in and treat the semi-colon as some sort of statement separator.
> Note that you *can* do things like
>
> |test|
>
> test:=OrderedCollection with: 'first'.
> test
>    add: 'second', 'third';
>    size
> because the 'second','third' is not a message send to 'test' but a
> separate clause that gets evaluated earlier.
>
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Java:  the best argument for Smalltalk since C++



________________________________________________________________________
iFRANCE, exprimez-vous !
http://web.ifrance.com


More information about the Squeak-dev mailing list