[Squeakland] Question: delays, collections, object instance variables

Alan Kay Alan.Kay at squeakland.org
Tue Mar 23 11:37:23 PST 2004


Hi Thomas --

At 7:28 PM +0100 3/23/04, Thomas Oeding wrote:
>forward for Poster at Kinetium dot Com <poster at kinetium.com>:
>
>Hi.
>
>Five questions from a newby.
>
>1. It appears that tiles placed in a script are executed as sequential
>Smalltalk statements. Is this correct?

Sort of. The general intent is that everything done in one tick of a 
script is one set of mostly parallel effects and what you will see is 
the results of these at the end of the tick. But this was never 
carried through all the way, so ....

Statements that write into variables are executed sequentially.

For moving objects you have a choice of "batching" or not. If 
batching is turned on (it's a preference that can be specific to 
individual playfields), then all movements of an object are done and 
then the placement is shown. This is most noticable when the pen is 
down. For example, if you are plotting a curve by changing x and y in 
separate tiles then you will get the expected staircase with 
"batching off", whereas you will get a single line to the endpoint 
reached if batching is on.

>
>2. Some tiles (e.g. make sound) appear to involve asynchronous calls to
>outside services, returning before completion of that service. For example,
>if I put 2 make sounds in sequence, they get garbled together.

Actually, they are just mixed.

>  Is my
>understanding correct, and is there a way to synchronize on the completion
>of the sound or to insert something like a delay between the calls so they
>are heard as two sequential sounds?

I'll defer to Scott Wallace here. This is certainly possible (and 
sometimes even desirable), but I don't know if it is currently a 
feature.

>
>3. Is it possible to use collections? e.g. can I make a collection of
>ladybugs and then use collection methods? I don't mind using text instead of
>tiles.

As I said in a previous email today, the etoys were made to do etoys 
things. As some of the Squeak hackers have mentioned, there are 
various ways to get past the fences, but then you are in a UI 
territory that is not particularly good for 10 year olds.

That being said, if you look in the Supply bin, you will find a 
Holder, and this has a collection protocol that can be found by 
looking in its viewer. Read Kim's book to see how a few things are 
done using the Holder. If you look in the viewer of a text object you 
will see what can be done there. I.e. look in the viewer of an object 
to see what has been set up for etoys. .......

>
>4. If I paint two eToys objects (sorry, don't know the right term), how can
>I set an instance variable of one to point at the oher?

Make the instance variable of type "Player". Look in the halo of an 
object and look at the balloon help on the different halo items. The 
brown one on the left hand side will give you a reference to the 
object. This can be used to set an instance variable to the this 
object. (We have never done this with children. It is generally much 
better to not use indirection when the children are learning.)

>
>
>5. Lastly, I noticed that if I view the text version of a script and edit
>it, then switch back to the tile view, I lose the edits I made. Is there a
>gradual way to transition from the tiles, drag-n-drop programming version to
>full(er) Smalltalk or is it an all-or-nothing abrupt jump?

We should turn this off, since it really has nothing to do with 
etoys. It is there for certain adults to play around with, but it 
isn't a supported feature of etoys. I don't think this is the best 
route to make the transition to full Smalltalk. One of these days -- 
not too far off but still a little unpredictable -- we will release a 
system that is inbetween the etoys and full Squeak, that should be 
nicely suitable for most adults and teenagers, etc.

Cheers,

Alan

>
>Thanks!! (and an email reply would be greatly appreciated).
>
>Newbie
>
>
>_______________________________________________
>Squeakland mailing list
>Squeakland at squeakland.org
>http://squeakland.org/mailman/listinfo/squeakland


-- 


More information about the Squeakland mailing list