[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Function Addresses?
- From: "Paul Hudson" <phudson@...>
- Date: Tue, 13 Jun 2006 16:29:00 +0100
My guess (not having looked at the C implementation) is that it's probably
easier to create a new closure on each call than work out that there's no
need in this particular case.
In general, you do need a different closure on each call, of course.
local i = 0;
return function () i = i + 1; return i; end
[mailto:firstname.lastname@example.org] On Behalf Of King, Mike
Sent: 13 June 2006 16:23
To: Lua list
Subject: RE: Function Addresses?
Why would it be desired to have a new anonymous function created for
return function () end
> a() is referring to the anonymous function "function return b() end"
> is different to both a and b