"LiveCode Infinity": lexically-scoped variables and bytecode blocks
dsc at swcp.com
Tue Jun 7 20:02:05 CEST 2016
In LiveCode, I tend to use small private functions. In a twisted sense, a handler that calls those does have block-based lexically scoped variables, the block is just pushed into a separate function.
On those occasions that I do write long handlers (for whatever excuse), I sometimes pretend that variables are block scoped for documentation reasons. I declare the variables right before the section they are used in. This might be confusing for others reading my code, though, so I minimize this.
I also use 'it' as though it has block scope and try not to let its life go beyond the chunks of a handler as my brain sees them. Clear use of 'it' often avoids the need of a variable. (Though a variable with a good name helps with documentation at times.)
So, for me, other improvements in compiling without language changes are more important.
> On Jun 7, 2016, at 11:27 AM, Dr. Hawkins <dochawk at gmail.com> wrote:
> On Tue, Jun 7, 2016 at 8:51 AM, Peter TB Brett <peter.brett at livecode.com>
>> Lexically-scoped variables are completely incompatible with the current
>> execution model of LiveCode Script. If you changed it, it would be from
>> many perspectives a different language.
> So are things such as strict compilation, case dependency, and the like
> (which I think should be defaults, but . . .).
> I do see lexical scope, named control structures, and the availability of
> strong typing as absolutely critical for the longterm (even to the level of
> being a a go/nogo issue).
> Dr. Richard E. Hawkins, Esq.
> (702) 508-8462
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode