>Yeh, possible. But I'd probably just put out a warning message about my ded
>pet salamander being able to program better, and run the script as if each
>line were a "do" command.
Anthony,
this error message has chances of getting into my list of feature
suggestions. I wouldn't like OC to have such un-descriptive error messages
as Serf (they're funny, but they don't help much), but a bit of fune sure
would be good. Like MPW's old ones, probably.
>The present architecture will not allow it. The new architecture will not
>either. And I don't plan on taking the (I'm guessing here) 20+% speed hit
>on _all_ scripts to allow it.
>
>Interpreter converts all variables and temporaries to a number. This number
>is used as an index into an array. NullCPU does not know and does not care
>about the name of the variables, and thus can't handle this.
>
>The only way I could see handling it is the allocate another variable. And
>that is just bad. It would mean reallocating the variable list if it is a
>new variable. It would involve some serious hackery to the compilation of
>the 'do' command, such as variable remapping [ouch!].
>
>All in all, I think the do command, the send command, and any run-time
>variable naming should be left in the scrap heap of history.
We need "do", we need "send". They have to be in there to allow for
additional flexibility and backward compatibility. As to allowing named
variables -- you could include a list of variable names with any handler,
mapping it to the number (this could be taken over from parsing and thus
wouldn't take much time). This will be needed for debugging anyway, which
means looking up by name would only be done in such cases, and would maybe
use hashes for a bit more speed, but of course it'll still be slower than a
conventional variable. But you won't get around implementing the stuff
creating custom variables need, as we also need to support globals, which
are also dynamically allocated.
>I don't mind arrays -- not to hard to handle. And if you REALLY want
>runtime-named variables, you can use perl-like hashes to fake them.
That's how MC's associative arrays work, I guess. The index to any item is
just a string, which is hashed and then looked up.
Cheers,
-- M. Uli Kusterer
------------------------------------------------------------
http://www.weblayout.com/witness
'The Witnesses of TeachText are everywhere...'
--- HELP SAVE HYPERCARD: ---
Details at: http://www.hyperactivesw.com/SaveHC.html
Sign: http://www.giguere.uqam.ca/petition/hcpetition.html