lua-users home
lua-l archive

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


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