[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: snapshot of Lua 4.1 (work)
- From: "John Batty" <john@...>
- Date: Thu, 1 Nov 2001 20:11:21 -0000
> Following the new visibility rules, the `a' is visible inside the enclosed
Is 'a' readonly inside the enclosed function (as with upvalues)?
Or can you modify the value of 'a' and have it changed outside the function?
----- Original Message -----
From: "Roberto Ierusalimschy" <firstname.lastname@example.org>
To: "Multiple recipients of list" <email@example.com>
Sent: Thursday, November 01, 2001 4:51 PM
Subject: Re: snapshot of Lua 4.1 (work)
> On Thu, 1 Nov 2001, Daniel Silverstone wrote:
> > Given that I've only scanned through the new manual I might have missed
> > but could you possibly give me an equivalent to the following 4.0
> > in 4.1-work ?
> > function add1(a,b)
> > if b == nil then
> > return function(bb) return add1(%a,bb); end
> > endif
> > return a+b
> > end
> First, you must change "endif" to "end" ;-) Then, you simply remove the
> from the code. Following the new visibility rules, the `a' is visible
> the enclosed function.
> -- Roberto