![]() |
sponsored links |
|
|
sponsored links
|
|
|
7
11th June 03:46
External User
Posts: 1
|
On Apr 9, 2004, at 11:58 PM, (Brian Harvey) <bh@cs.berkeley.edu>:
Another way of thinking of this is that these expressions are equivalent: REPEAT 36 [FD 10 RT 10] REPEAT 36 (LIST "FD 10 "RT 10) REPEAT 36 (LIST "FD "10 "RT "10) REPEAT 36 SE (LIST "FD 10) (LIST "RT 10) And at least UCBLogo I believe would allow: REPEAT 36 "PENUP Since evaluating a single word is like evaluating a list with that word as the only member. Then lastly, it's important to realize that REPEAT is not a specially-defined procedure, just something like: TO REPEAT :num :block WHILE [:num > 0] [RUN :block MAKE :num :num - 1] END -- Ian Bicking | ianb@colorstudy.com | http://blog.ianbicking.org LogoForum messages are archived at: http://groups.yahoo.com/group/LogoForum |
|
|
8
11th June 03:46
External User
Posts: 1
|
On Apr 9, 2004, at 11:57 PM, (Brian Harvey) <bh@cs.berkeley.edu>.
I'd say it's vague what the difference between tokenizing and syntax parsing is. To me it's parsing when [[nested]] produces a list that contains a list that contains "nested. If it was *just* tokenizing, the result would be a list containing "[, "[, "nested, "], "]. So I consider producing nested structures to be a kind of simple parsing. I have thought about saving the "full" parsing -- or doing the full parsing immediately (as Logo->Scheme does), but I wonder why it's really necessary? Does it actually lead to any performance improvement? If you stick to straight interpretation, the expensive parts aren't related to the parsing. Really, Logo is like a backwards Forth (as Paul alluded to), except with slightly more formalism since procedure objects have ******** arity. Forth never had performance problems because you couldn't decompose the program into discrete expressions. In the same way, once you have a procedure and you know how many inputs it takes, is it really burdensome to grab that many values from forward expressions? I suppose once you've parsed it into expressions, you make available all sorts of conventional optimizations that are targeted at languages which are structured like that. This was no doubt important to ObjectLogo, where they were building on their Lisp experience. But does this mean anything for most of the other Logo implementations, where they aren't performing any of these complex optimizations (nor are they likely to)? Or at least, I expect there's other optimizations that would provide a more immediate benefit. -- Ian Bicking | ianb@colorstudy.com | http://blog.ianbicking.org LogoForum messages are archived at: http://groups.yahoo.com/group/LogoForum |
|
|