Lagi Pittas wrote:The following was used by Rebecca Bettencourt to test the parsing of her openxion non gui version of hypertalk. She called it the Winkler Test
...
Code: Select all
put empty into a
put "a b c" into item
put 1 into char
put 2 into word
if true then repeat with word char of item = char char to word of word char of char to word char to char of char char of word
put a&&"HyperTalk is a bitch to parse
end repeat else beep
the correct output is
1 "HyperTalk is a bitch to parse
2 "HyperTalk is a bitch to parse
Offhand I can see at least two issues there:
- Line 2: "item" is a chunk type, and as such should not be used as a variable name.
"Item" is semantically akin to an adjective, but used here as a noun. The expression "into item 1 of tString" would make sense, but simply "into item" makes no more sense than telling your doctor you have a pain in your "left", without specifying whether you mean "left arm", "left leg", "left kidney", etc. A doctor would be correct to express confusion with that, as would any script parser being confused with that line as written.
- Second-to-last line: No closing quote for the string.
I don't know of any language where not specifying the end of a string literal would be acceptable. In HTML, the absence of a closing element causes everything following the opening element to be assigned that element's attributes. Most (including JavaScript) will simply throw an error. Here it seems there's an expectation that CR should be handled as a synonym for double-quotes. Such an expectation seems murky.
If HyperCard flagged neither as an error, that itself would seem an error.
I don't know whether Dan Winkler coded Hypertalk) or whether it was Bill Atkinson coded both the Hypercard and the language created by Winkler but it certainly shows progtramming prowess in the extreme to do all this in 68000 Assembly code.
The idea of adding a scripting language to Wildcard (HC's code name), which was originally conceived as having point-and-click authoring only, is a controversial topic, with a couple different versions floating around as to how that happened. But I believe once the decision was made it was mostly the work of Dan Winkler to flesh out the details.
Even more Kudos to Tom Pittman createing a full compiler that spit out 68000 machine code all in in Hypertalk itself.
Did you use it? It was very inventive indeed, but required using syntax that was often very different from scripts compatible with the HyperTalk interpreter, understandable given the very different requirements and goals.
And that's how it's been with just about everything that was HyperCard-like but not HyperCard itself. OMO, SuperCard, Toolbook, Gain Momentum, Plus, and maybe a couple others - they each brought something different to the table, and had different syntax to support their different goals.
Explorations comparing HyperCard and later dialects can sometimes be interesting, but so much of the world of scripting, and even computing in general, has changed so much that we can expect the many differences in implementations to only continue to grow over time.
Spanish is based on Latin, but a modern Spanish speaker can't be expected to understand everything said in Latin.