Brian Harvey wrote: > > Yehuda Katz <yehuka@beitberl.ac.il> writes: > >I'm expecting a *primitive* function (instead of the 5 suggested library > >functions), named maybe TURTLE, that will enable commands like: > > > > SETXY TURTLE 5, SETH TOWARDS TURTLE 4, etc. > > I don't understand the semantics of this proposed function. Does this > example mean "set the current turtle's position to turtle 5's position, > and set the current turtle's heading towards turtle 4's position"? Brian, Thank your for your input. My proposed TURTLE :N function reports the location ( as a list) of that turtle. So, saying SETPOS TURTLE 5 (not SETXY, sorry) is exactly as unique as SETPOS [100 100], SETH TOWARDS TURTLE 4 is exactly as unique as SETH TOWARDS [100 100], DIST TURTLE 5 is exactly as unique as DIST [100 100].. > But I gather that it doesn't always mean the position. What I propose is always the position, and only the position. > Do you expect > to be able to say > > SETH TURTLE 4 > > to mean "set the current turtle's heading equal to turtle 4's heading"? No, SETH TURTLE 4 is exactly as meaningless as SETH [100 100], so you will get a "did not output" error message. > Because if so, then TURTLE is not a proper function; its result depends > on something other than the arguments you give, namely, the context in > which you use it. > (That is, if you just said SETH it returns a heading; No, as I said, SETH TURTLE 4 will give an error message. > I think that example would have to be SETPOS anyway.) Correct, sorry about that. > Starting in LogoWriter and even more in Microworlds, LCSI has hacked up > their syntax quite a bit so that it's no longer true that everything is > a procedure call. Their goal has been to make the notation "do the > right thing" in common cases, at the cost of making the syntax itself > quite tricky if you really look at it. > > I dunno if I'd want to go down that path. What about going the path I propose? Regards... [[Yehuda]] --------------------------------------------------------------- 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