[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Globals (more ruminations)
- From: Geoff Leyland <geoff_leyland@...>
- Date: Fri, 16 Jul 2010 12:42:02 +1200
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
- References:
- Re: Globals (more ruminations), Mark Hamburg
- Re: Globals (more ruminations), Roberto Ierusalimschy
- Re: Globals (more ruminations), Geoff Leyland
- Re: Globals (more ruminations), Alexander Gladysh
- Re: Globals (more ruminations), Roberto Ierusalimschy
- Re: Globals (more ruminations), Juri Munkki
- Re: Globals (more ruminations), Roberto Ierusalimschy
- Re: Globals (more ruminations), Patrick Donnelly
- Re: Globals (more ruminations), Roberto Ierusalimschy
- Re: Globals (more ruminations), Geoff Leyland
- Re: Globals (more ruminations), Roberto Ierusalimschy
- Re: Globals (more ruminations), Geoff Leyland
- Re: Globals (more ruminations), David Manura