lua-users home
lua-l archive

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


Michael Roth wrote:
What about a more general solution:

select(i,..)    -->    slice(i, i, ...)
skip(i, ...)    -->    slice(i, ...)
first(...)    -->    slice(1, 1, ...)
first(i, ...)    -->    slice(1, i, ...)
tail(...)    -->    slice(2, ...)
last(...)    -->    slice(-1, ...)
last(i, ...)    -->    slice(-i, ...)

Excuse my old complaint about counting from 1 and closed ranges, but how about a slice starting from i of length 0?

-John

--
http://giftfile.org/  ::  giftfile project