lua-users home
lua-l archive

Re: [ANN] Lua 5.2.0 (work1) now available

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


Patrick Donnelly wrote:
> 
> I don't see any error in the implementation here. Try this:
> 
>> do
> T=setmetatable({},{
> __len=setmetatable({gth=0},{
> __call=function(o) return o.gth end
> })
> })
> getmetatable(T).__len.gth = 3
> print(#T)
> end
> 3
> 
> ?
> 
My mistake. I thought Lua would try to return #__len if it was a table.
Of course it does no such thing.
-- 
- tom
telliamed@whoopdedo.org

AltStyle によって変換されたページ (->オリジナル) /