logo       

Re: Chaining versus cascading: msg#00112

lang.smalltalk.squeak.beginners

Subject: Re: Chaining versus cascading

On 9/20/07, Chris Cunnington <cunnington@xxxxxxxxxxxx> wrote:
Hi,

I have a question about the difference between chaining and cascading. What
would happen if you wrote this:

Html table id: 'label' with: [foo foo foo]

You see, I've left out the semicolon that the sushi store demo puts between
'label' and with. It usually looks like this:

Html table id: 'label'; with: [foo foo foo]
 
Well, the first example is sending the method #id:with: to Html table.  The second example is the equavalent of:
Html table id: 'label'.
Html table with: [foo foo foo].
 
The cascading operator (the semicolon ;) causes the next message (#with:) to be sent to the previous messages (#id:) receiver (in this case, Html table).

 
_______________________________________________
Beginners mailing list
Beginners@xxxxxxxxxxxxxxxxxxxxxxxxxx
http://lists.squeakfoundation.org/mailman/listinfo/beginners
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise