[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: self
- From: Miles Bader <miles@...>
- Date: Fri, 16 Mar 2007 07:22:56 +0900
Graham Wakefield <lists@grahamwakefield.net> writes:
> Except that I can't figure out how to make a copy of a function in Lua
> (or in the Lua API). I guess I need to create a new closure, which I
> can do with a cfuntion, but I can't see how to do it with a lua
> function.
function copy_fun (fun)
return function(...) return fun(...) end
end
?
[The extra level of indirection is ever so slightly annoying, but ...]
-miles
--
"Whatever you do will be insignificant, but it is very important that
you do it." Mahatma Gandhi
- References:
- Re: Colon Operator: Superfluous Syntax?, gary ng
- Re: Colon Operator: Superfluous Syntax?, Brian Hagerty
- Re: Colon Operator: Superfluous Syntax?, Rici Lake
- Re: Colon Operator: Superfluous Syntax?, Brian Hagerty
- Re: Colon Operator: Superfluous Syntax?, David Haley
- Re: Colon Operator: Superfluous Syntax?, Brian Hagerty
- Re: Colon Operator: Superfluous Syntax?, Kein-Hong Man
- Re: Colon Operator: Superfluous Syntax?, Brian Hagerty
- Re: self (was Colon Operator: Superfluous Syntax?), Graham Wakefield
- Re: self (was Colon Operator: Superfluous Syntax?), Graham Wakefield