lua-users home
lua-l archive

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


On Mon, Jun 8, 2015 at 7:31 PM, Rena <hyperhacker@gmail.com> wrote:
> On Mon, Jun 8, 2015 at 10:28 PM, Coda Highland <chighland@gmail.com> wrote:
>> On Mon, Jun 8, 2015 at 7:16 PM, Rena <hyperhacker@gmail.com> wrote:
>>> On Mon, Jun 8, 2015 at 6:39 PM, Coda Highland <chighland@gmail.com> wrote:
>>>> On Mon, Jun 8, 2015 at 3:39 PM, Coda Highland <chighland@gmail.com> wrote:
>>>>> On Mon, Jun 8, 2015 at 3:29 PM, Soni L. <fakedme@gmail.com> wrote:
>>>>>> Python has it.
>>>>>
>>>>> Python also has global-by-default. Your point?
>>>>>
>>>>> /s/ Adam
>>>>
>>>> Erf. LOCAL by default.
>>>>
>>>> /s/ Adam
>>>>
>>>
>>> Python has a lot of nice things, some of which I miss in Lua, but if
>>> Lua had all those things, it would no longer be Lua; it'd be Python.
>>> (Also Lua has a lot less magic, which I appreciate!)
>>
>> Local-by-default is not one of those nice things.
>>
>> And I say this as someone who likes Python.
>>
>> /s/ Adam
>>
>
> I do find it makes it a bit less obvious what an object's scope is.
>

Worse, it makes upvalues very challenging, as they are neither local
nor global yet no way exists to explicitly target them in Python 2.x.
(If you try to assign to an upvalue, you instead create a new local
that shadows it!)

/s/ Adam