[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [proposal] A statement that can return value (and can used in expr)
- From: Wim Couwenberg <wim.couwenberg@...>
- Date: Tue, 13 Dec 2011 21:21:08 +0100
> Lua 5.2 will not: it will resuse the closure.
when it can. with different upvalues you get different functions (of course):
> for i=1,3 do
> local f = function(a, b) print("run " .. i ..": a statement") return a + b end
> local a = f(10, 20) + 30 + i
> print(f,a)
> end
Bye,
Wim