lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Nov 01, 2001 at 04:24:13PM +0000, 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 ?

Oops, okay then, so it's just:
function add1(a,b)
 if( b == nil ) then
  return function(bb) return add1(a,bb); end;
 end
 return a+b
end

??

Will the created closure also have a reference to 'b' ? or is the closure
creator clever?

Daniel

-- 
Daniel Silverstone                               http://www.digital-scurf.org/
Hostmaster, Webmaster, and Chief Code Wibbler          Digital-Scurf Unlimited
GPG Public key available from germany.keyserver.net            KeyId: 20687895
If we all work together, we can totally disrupt the system.