lua-users home
lua-l archive

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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, ...)

Maybe, 'first' should be really called 'head'.

A usage of these might be...

	function call(...)
	  return head(...)(tail(...))
	end

;-)


Michael Roth
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBJdI+SIrOxc3jOmoRAnt+AJ9vjLSbjYHWlmtn1H2q0XDnn2oU+gCfT5kj
XLiB3Xy5dG6+ceNy63frO7U=
=8LSv
-----END PGP SIGNATURE-----