lua-users home
lua-l archive

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

The main problem here is that such a change to Lua would break lots of code
in non-obvious ways.  The only way to even partially make such a change is
to require both the "global" and "local" keywords and say that x=4 without x
being an argument, global, or local is an error in a function.

A strong case can be made for read-only access to globals within functions,
declarations being required for write access, and unlabeled assignments
defaulting to local, but that's a fairly huge change to the language.

Lua's scoping isn't what some of us (including me) would choose but given
the tools in the language that can be used to ameliorate the problems is it
even possibly worth changing Lua?  Lua authors what's the word on this?  Is
such a change even something you'd consider?  If not, we should stop
worrying about it or go off and make the changes ourselves.


> From: Reuben Thomas <>
> Reply-To:
> Date: Wed, 13 Sep 2000 12:18:19 +0100 (BST)
> To: Multiple recipients of list <>
> Subject: Re: "global": other scripting languages & suggestion
>> make it implicitly local.  Past experience in scripting
>> languages seemed to show that making variables implicitly global,
>> is simply too error prone.
> I agree strongly with this, and I too feel it's Lua's biggest problem.
> -- 
> | wit, n.  educated insolence (Aristotle)