lua-users home
lua-l archive

Re: sunday afternoon whishlist

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


On 2010年5月10日 09:26:37 +0300
"Juris Kalnins" <juris@mt.lv> wrote:
> Actually, it would be more powerful to have [] operator take arbitrary 
> number of
> values, just like () does.
> Then:
> x.y.z --> x[y,z] --> x_metatable.__index(x,y,z)
> x.y.z = v --> x[y,z] = v --> x_metatable.__newindex(x,y,z,v)
> x[] --> x_metatable.__index(x)
> etc.
> 
> And have default behavior forward indexing calls to nested
> elements, just like it works now.
> 
> This would allow a simple way to implement things in the wishlist,
> plus simplify many cases that currently require use of proxy objects.
Waow, this would directly provide matrix syntax with a very simple metatable.
Denis
________________________________
vit esse estrany ☣
spir.wikidot.com

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