[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: snapshot of Lua 4.1 (work)
- From: Roberto Ierusalimschy <rieru@...>
- Date: Thu, 1 Nov 2001 10:51:48 -0600 (CST)
On Thu, 1 Nov 2001, Daniel Silverstone wrote:
> Given that I've only scanned through the new manual I might have missed it,
> but could you possibly give me an equivalent to the following 4.0 function
> in 4.1-work ?
> function add1(a,b)
> if b == nil then
> return function(bb) return add1(%a,bb); end
> return a+b
First, you must change "endif" to "end" ;-) Then, you simply remove the '%'
from the code. Following the new visibility rules, the `a' is visible inside
the enclosed function.