"Tell" and "Siblings"

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

"Tell" and "Siblings"

Guyren Howe
What does it do when a sketch "tells" other sketches one of its scripts?

And what does "sibling" mean?

In general, what means are available for sketches to communicate?

Thanks.
_______________________________________________
Squeakland mailing list
[hidden email]
http://squeakland.org/mailman/listinfo/squeakland
Reply | Threaded
Open this post in threaded view
|

Re: "Tell" and "Siblings"

Scott Wallace
On Nov 16, 2006, at 12:08 AM, Guyren Howe wrote:

> What does it do when a sketch "tells" other sketches one of its  
> scripts?

Hi, Guyren,

The tile command "Car tell all siblings foo" means to send the  
message foo to all the Car's siblings, which means that each of Car's  
siblings will invoke its own script named "foo", if it has one.  
Siblings of Car are copies of it that were created with the "olive"  
halo handle or by using the "copy" tile; all siblings share exactly  
the same code, so that if you change the code of one, the change  
affects all.


> And what does "sibling" mean?

Here are some links that may be useful in getting started with  
"siblings":

http://squeakland.org/pipermail/squeakland/2004-December/002329.html

http://squeakland.org/pipermail/squeakland/2004-December/002334.html

http://squeakland.org/pipermail/squeakland/2005-January/002341.html


> In general, what means are available for sketches to communicate?

Some primary means for objects to communicate etoy-style are:
   (a)  One object simply tells another object to invoke a script  
(e.g. Car avoidWall).
   (b)  One object tells all of its siblings to invoke a script (e.g.  
Car tellAllSiblings crashAndBurn).
   (c)  A container tells of the objects within it to invoke a script  
(e.g. Playfield tellAllContents turnGreen).
   (d)  An object finds out information about another object by  
"getting" values from it, e.g. "Car turn by Wheel's heading".


Hope this helps.  Please fire away with any more questions.


Cheers,

   -- Scott

_______________________________________________
Squeakland mailing list
[hidden email]
http://squeakland.org/mailman/listinfo/squeakland