[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Global by default
- From: Coda Highland <chighland@...>
- Date: Tue, 12 Feb 2013 11:30:44 -0800
On Tue, Feb 12, 2013 at 11:23 AM, Peter Slížik <firstname.lastname@example.org> wrote:
> Hey, this explains a lot:
>> Making all variables global by default was a decision taken in the very
>> days of the design. The rationale is that Lua is designed to be used as
>> a configuration language, where end users will hardly ever write their own
>> functions. Now imagine the mess of having to write
>> global fgcolor="red"
>> global bgcolor="white"
>> global tolerance=0.001
>> This seems quite verbose and useless, from the point of view of the end
>> So the decision of having globals by default makes sense to us ;-) and
>> we don't feel we need to change it.
> (Words by lhf, http://lua-users.org/lists/lua-l/1997-12/msg00009.html )
> However, from what I've gleaned on the web, I had the impression that "local
> by default" policy was what prevented Python from having proper lexical
> and vice versa - that lexical scoping prevents Lua from implementing "local
> by default".
> Is this true?
Pretty much, yeah.