Bill Kerr wrote in message <000201be183d$78328100$9cfc98cb@kerrb>... >Ken Kahn wrote: >>I am not aware of any way to synchronize parallel processes in Microworlds. > >I think this MicroWorlds procedure (from MW help on waituntil and also >done?) does synchronise parallel processes: > >to sq-circ >t1, pd launch [repeat 36 [fd 10 rt 10]] >; t1 draws a circle >t2, pd launch [repeat 4 [fd 50 rt 90]] >; t2 draws a square >waituntil [done? [repeat 36 [fd 10 rt 10]]] >; the procedure does not continue until the circle is finished >; so that the drawings of circles and square are synchronised >t1, pu rt random 360 fd random 50 >t2, pu rt random 360 fd random 50 >; repositions turtles for next drawing >sq-circ >end > I stand corrected, thanks. This is a kind of control flow synchronization since it waits until the processes spawned for t1 and t2 have terminated. Or does "waituntil [done?" wait until all processes have terminated? Does MicroWorlds also have process synchronization based upon data? So, for example, a consumer process of some data waits until the generator has generated it? Note that in general the generator need not have terminated, it may just be reporting back results as it finds them (e.g. a web search engine). ToonTalk only has data synchronization but that is the more general kind of synchronization, since one can set data (in ToonTalk give a bird a token) indicating that the process is just terminating. By the way, is there a MicroWorlds manual on the web somewhere? >>And the only way processes can communicate is via global >>variables. This is poor modularity and can lead to extremely hard to track >>down bugs. And in what sense is Microworlds object-oriented? > > >MicroWorlds has a turtlesown primitive that enables you to localise things >like the speed or reset position of a turtle which is, for instance, >simulating a horse. I'll paste in the MW help explanation here, which will >give us some sort of starting point for further discussion. I'm not trying >to suggest that MW is fully object orientated but code can reside on objects >such as colours, turtles, buttons. This gives students an introduction to >elementary oops concepts and for young kids I can't see the point in going >beyond that. MW and logo has local variables which would be the main thing, >wouldn't it? My main impression from doing a little bit of java oops earlier >this year is that everything is 10 times harder than in using logo. > ><start of paste from MW help> >turtlesown word > >Assigns a variable to all the turtles in the current project. This variable >can then be set to a specific value for each turtle. This command also >creates a new primitive made of the word set followed by the name of the >variable (e.g., turtlesown "speed creates a setspeed command as in t1, >setspeed 12). >There are two ways to get the value of a given turtle variable: you can talk >to a turtle and use the variable name to report the value (e.g., t1, show >speed displays 12 in this example) or you can use the turtle name followed >by 's (e.g., show t1's "speed displays 12). > >Use remove to remove a turtle variable. This removes the named variable for >all the turtles in the project. >After a turtlesown instruction, the value of the variable is set to the >empty list (see the first three lines in the example below). >Example: > >turtlesown "speed >t1, show speed > (empty list) >t1, setspeed 10 >t2, setspeed 20 >t3, setspeed 5 >t1, show speed >10 >show t2's "speed >20 >everyone [fd speed] >everyone [forever [fd speed]] > >Choose Stop All from the Edit menu. > >remove "speed ><end of paste from MW help> > To me, and many others, the essence of the idea of an object is that it joins local data and behavior. You ask a object to move and whether it walks, swims, or flies depends upon the kind of object it is and what "move" methods have been associated with it. "turtlesown" does give objects some local data (but it is odd that every object in the system has the same set of local variables). But behavior is critical. (I don't happen to think inheritance is critical, though it is often quite nice.) Best, -ken kahn (www.toontalk.com) --------------------------------------------------------------- Please post messages to the Logo forum to logo-l@gsn.org. Mail questions about the list administration to logofdn@gsn.org. To unsubscribe send unsubscribe logo-l to majordomo@gsn.org.
Global SchoolNet Foundation -
Linking Kids Around the World!
Copyright GSN - All Rights Reserved
- Comments
& Questions
Visit GSN's
Global
Schoolhouse for more exciting learning resources!
Search our Site
-
Home