lua-users home
lua-l archive

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


On Wed, Dec 15, 2010 at 11:44:01PM +0200, Luiz Henrique de Figueiredo wrote:
> > Two extensions to Lua needed:
> >     3:6             --> {3,4,5,6}
> >     a[{3,4,5,6}]    --> {a[3],a[4],a[5],a[6]}
> 
> The second at least can be done with __call if you use the syntax
> 	a{3,4,5,6} or a({3,4,5,6})
> 
In that case, one can borrow a Python word and use 'range(3,6)' for 
{3,4,5,6}.  How about assigning to an array slice?

Dirk