[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Microlight (was Re: paving cowpaths with libraries)
- From: steve donovan <steve.j.donovan@...>
- Date: Fri, 17 Feb 2012 08:57:50 +0200
On Fri, Feb 17, 2012 at 2:25 AM, ernie <elukie@comcast.net> wrote:
> What is the reason for this on line 148?
>
> local tbuff -- <=======
> function tbuff (t,buff,k)
> ...
> end
tbuff is a recursive local function, so the symbol must be declared
before the definition. It helps to remember that 'local function f' is
short for 'local f = function' - so any reference to f in that
_anonymous_ function doesn't find the local because it's not defined
yet.
local tbuff
tbuff = function (t,buff,k)
.-- refer to local tbuff!
...
end
steve d.