Mystery with arrays (lost key)
Robert Brenstein
rjb at rz.uni-potsdam.de
Wed Apr 10 05:29:01 EDT 2002
>For me, the use of non-quoted literals is more the source of
>confusion than any other factor. If they weren't allowed, then MC
>would require the above lines in question to look like this:
>> put 1 into test2
>> put 55 into GrandTotals["test1"]
>> put 66 into GrandTotals[test2]
>> put 22 into GrandTotals["test3"]
>
>Then it would be explicit and clear why keys(GrandTotals) are what
>they are above:
>> 1 -- (value of 'test2' variable, used as a key)
>> test1 -- ("test1" string)
>> test3 -- ("test3" string)
>
>I believe MC's assumption about 'test1' and 'test3' being char
>strings was meant to make life easier for us. In this case, however,
>MC's ease-of-use string-handling seems to be giving us enough rope
>to hang ourselves!
>
As far as I know, the use of non-quoted literals comes from HyperTalk
and Scott strongly recommends to always quote literals. It is
definitely a cleaner way to code and eliminates any ambiguities.
Robert
More information about the metacard
mailing list