lua-users home
lua-l archive

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


On Mon, Jan 10, 2011 at 5:55 PM, Geoff Leyland
<geoff_leyland@fastmail.fm> wrote:
> On 11/01/2011, at 11:41 AM, Javier Guerra Giraldez wrote:
>
>> On Mon, Jan 10, 2011 at 5:38 PM, Geoff Leyland
>> <geoff_leyland@fastmail.fm> wrote:
>>>  If, that is, there was any advantage of newproxy over a proxy table.  Anyone know if there is one?
>>
>> until 5.1, you couldn't override #t for tables
>
> Do you mean 5.2?
>
> $ lua
> Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
>> a = setmetatable({}, { __len = function() return 5 end })
>> print(#a)
> 0

hum.... as i understand it, 'until x' includes x

anyway, what i meant was: in 5.1 and previous, tables didn't honour
__len.  On 5.2 they do, so newproxy() become's less needed.


-- 
Javier