lua-users home
lua-l archive

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


On Friday 20 August 2004 09:55, Roberto Ierusalimschy wrote:

> > skip(i, ...)    -->     slice(i, ...)
> > first(...)      -->     slice(1, 1, ...)

> How would you know whether the second "1" is a counter or the first
> value from `...´?

Couldn't the compiler/interpreter put the proper backend in for this?

Maybe I'm missing something here. Are the dots above literals meant to 
represent what is currently called 'arg', or do you intend to be able to use 
'slice()' for things such as:

  > print(slice(1, 2, 3, 4, 5))
  3       4

Either name slice() or select() works. But I like Michael Roth's all-in-one 
version to handle first, last, etc.

-- 
--__-__-____------_--_-_-_-___-___-____-_--_-___--____
Doug Rogers - ICI - V:703.893.2007x220 www.innocon.com
-_-_--_------____-_-_-___-_--___-_-___-_-_---_--_-__-_