Do (was: a Condition stored as a variable)
DunbarX at aol.com
DunbarX at aol.com
Thu Oct 22 17:28:15 EDT 2009
This was one of the unsung, and unsupported features (bugaboos?) of HC.
It all started when one tried to, say, "put someThing into the foundLine".
A "do" construction was required to perform a multiple evaluation of the
code so the parser could make sense of what you really wanted to do. Otherwise
the "foundLine" (or its sisters) could not be used that way, right away, at
all, even though it seemed to read just fine. This was especially true when
when building code constructs combining literals, variables and other
oblique, convoluted chunk or object references all into a single line.
The rule was something like "if it seems like it ought to work, but
doesn't, try rewriting using a 'do' construction". I apologize either to Danny
Goodman or to Winkler, Kamins and deVoto.
I was surprised that Rev also needs this extra evaluation at times, that it
couldn't, er, do such a thing on its own if the parser felt it needed a
boost, and report its failure at runtime.
Craig Newman
In a message dated 10/22/09 3:48:15 PM, andre at andregarzia.com writes:
> creating code at runtime and executing it is one of the fun things in
> programming. You can go crazy with it by creating code that creates code
> that creates code that... If there were no scriptlimits we could roll our
> own macro expansion engine with it.
> Be aware that you can only execute up to 10 lines of code using "do" in
> standalones.
>
More information about the use-livecode
mailing list