lua-users home
lua-l archive

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


On 16/07/2010, at 12:31 PM, David Manura wrote:

> On Thu, Jul 15, 2010 at 5:18 PM, Geoff Leyland
> <geoff_leyland@fastmail.fm> wrote:
>> The problem is that you won't get global checking for functions defined inside functions and other scopes....
>> The global proposal offers static checking and can check the top level,...
> 
> As I understand it, this global checking would apply to everything
> within the scope of the global declaration (nested functions and
> nested scopes included).


Sorry, I wasn't clear.

>> The problem is that you won't get global checking for functions defined inside functions and other scopes....

*If* "function f(...)" was sugar for "global f = function(...)" then the global checking wouldn't work on functions.  That might be a nice feature in the top level scope, but it would not be a nice feature in any nested scope.  (I'm shooting down my own suggestion)

>> The global proposal offers static checking and can check the top level,...

strict.lua does not check assignments to globals at the top level.  I share your understanding of global - it checks all nested scopes.

Geoff