UnitedLexCorp / SimpleTalk

An implementation of HyperTalk in Ohm-js
Apache License 2.0
7 stars 1 forks source link

Tell and target contexts not compatible #194

Open dkrasner opened 3 years ago

dkrasner commented 3 years ago

Main Points

I'll illustrate this issue with an example:

Imagine we have a button and have set a target on it.

The following two scripts will do exactly the same thing:

on click
    tell target to set "text-color" to "red"
end click

and

on click
    tell target to tell target to set "text-color" to "red"
end click

which in my view is counter-intuitive. The reason for this is that target is interpreted in the context of the underlying script, which in this case the on click handler above. And this is true for any target in the script, even if it is an object specifier of a context switching tell command, is interpreted in the original context.