4 ms·
Yes, it's a do-while loop. It takes two arguments ("cond" and "proc") which would both be bracketed lists. "unless" is common sugar for a negated if statement.
by RodgerTheGreat 5y ago
Yes, it's a do-while loop.
It takes two arguments ("cond" and "proc") which would both be bracketed lists.
"unless" is common sugar for a negated if statement.
"run" evaluates a list as an expression. You'll notice that if/unless also take their bodies as lists, rather than any sort of special-purpose block syntax.
"stop" short-circuits the current procedure and immediately returns.
Since Logo has dynamic scope, any variable references in "cond" and "proc" will resolve the same within "while" as they did in its caller; no nasty visibility surprises. Since Logo does not eagerly evaluate lists, there is no need to "quote" or otherwise escape the lists in the caller's context. It is precisely that one can define such a construct without defining new syntax per se that is useful.
- xapata 5y ago> there is no need to "quote" or otherwise escape the lists in the caller's context. That's a handy feature. Thanks for the explanation.