lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> I'll give it more thought.  What about old code like
> the following in your
> system:
> function f()
> local x = 4
>     x = 3 -- is this legal?
> end
> It would need to be legal for any old code to work.

Yes: existing code would work unchanged.

> 3. both assignments (or maybe just '=') could be
> overridden with explicit
> local or global keywords (note, overriding '=' is
> needed for backward compatibility). [...]
> Why impose a style? 

Actually, I'd rather suggest enforcing a style in 
which "=/local" and ":=/global" cannot be mixed in
the same function.  That way, the compiler can
generate more meaningful warning/error messages.

Anyway, I'll play around with the implementation
a bit more.  Maybe I can generate a patch for this
or a closely related proposal.


Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!