[E-Lang] Syntax change: reducing side-effects
Mon, 12 Feb 2001 22:04:15 -0800
Thanks for all the comments!
>Summary: all defining occurrences of names now default to 'final', unless
>they are prefixed by 'var', in which case they are settable. In addition,
>'var' can be used as a top-level construct as an alternative to 'define'
>(equivalent to 'define var').
One minor nit left; does the following mean anything?
var [foo, bar] = [3, 4]
The alternatives are:
def var [foo, bar] = [3, 4]
which I presume the parser sneers at; or:
def [var foo, var bar] = [3, 4]
which I presume the rest of us sneer at; i.e., I prefer the compiler
rejection because it seems that any principle that would make the
dissociated 'var' semantically correct would also increase the perceived
complexity and violate the basic rule of making assignable variables
painfully clear. (If you find that sentence hard to parse, remember that
the next time you write deeply nested code...).