[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: what do you think of this?
- From: Rob Kendrick <lua-l@...>
- Date: Thu, 05 Feb 2004 00:29:32 +0000
On Thu, 2004-02-05 at 00:01, Asko Kauppi wrote:
> Insteead of the regular "_,_, str= string.find( " I'm considering
> using the following functions:
<snip>
> What do you normally do - are there better ways to achive this?
I've used a more generic form in the past:
function n(n, f, ...)
return ({ f(unpack(arg)) })[n]
end
So you can have foo = n(3, string.find, "Hello World", "ll", 1, 1) etc.
It is a bit ugly, though.
--
Rob Kendrick, Pepperfish Ltd. +44 (0)845 226 4146 www.pepperfish.net
PGP signed or encrypted mail welcome Key ID: 3651D17A