lua-users home
lua-l archive

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


> According to this page:
> 
> http://www.lua.org/pil/6.2.html
> 
> According to that page, there's a subtle difference between
> 
> foo=function(x)
> 
> and
> 
> function foo(x)
> 
> when it comes to declaring recursive functions. I'm not saying this has 
> anything to do with your situation, I'm just pointing out that in certain 
> situations they're not identical.

You are mixing two different things. The constructions
|foo=function(x)...end| and |function foo(x)...end| have exactly
the same meaning.  The "subtle" difference is between 
|local foo=function(x)| and |local function foo(x)|. Note that the
second form is an explicit construct in Lua,
not a |function foo(x)| inside a common 'local' declaration.

-- Roberto