On Thu, 9 Aug 2001 09:47:41 -0700, "Michael Chean"
<
[hidden email]> wrote:
>I guess I'm a little unclear on the cascading, and that probably has to do
>with the fact the in Foxpro, the semicolon is
>used as a line extension. I'll go back and reread the section in the
>tutorial.
Michael,
Unlike FP, Smalltalk does not need a line continuation since it has a
line termination. This means a "line" can be on as many lines as you
wish to express and end it with a period.
A ; is used for cascading statements. Cascading in Smalltalk is just a
shortcut to save you from repeating the object over and over when
sending messages to it.
A simple example of cascading is:
animal:= Dictionary new.
animal at: 1 put: 'cat'; at: 2 put: 'tiger'; at: 3 put: 'lion'.
otherwise you would have to do:
animal at: 1 put: 'cat'.
animal at: 2 put: 'tiger'.
animal at: 3 put: 'lion'.
costas