[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: sunday afternoon whishlist
- From: spir ☣ <denis.spir@...>
- Date: Mon, 10 May 2010 11:01:56 +0200
On Mon, 10 May 2010 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