Chaining versus cascading

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Chaining versus cascading

Chris Cunnington-5
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]

It seems odd to throw in a cascading semicolon just in there and then move
on.

I understand if you have:

DiskController reset initialize startRunning.
DiscController reset; intitialize; startRunning.

The difference is that initialize will act on the result of DiskController
reset. The second line, the cascaded line, is just giving DiskController
three orders one after the other.

The returned object from html table would get passed the selector id:'label'
and the returned object from that would get passed with: [foo foo foo].

Oh, wait a minute. I guess we want to pass two separate messages to the
object table, one after another. Does that mean we could break the line into
two statements:

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

Yes? No?

Chris Cunnington

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
cbc
Reply | Threaded
Open this post in threaded view
|

Re: Chaining versus cascading

cbc
On 9/20/07, Chris Cunnington <[hidden email]> 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
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Chaining versus cascading

Chris Cunnington-5
Re: [Newbies] Chaining versus cascading        Hi Chris Cunningham,

Thank you for replying to my question. Now that you’ve explained it I wonder how I could have been confused before.

Cheers,

Chris Cunnington



_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners