lua-users home
lua-l archive

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


On 11/21/12, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 2012/11/21 Robert Virding <robert.virding@erlang-solutions.com>:
>> local f=1 print(f)
>> local f print(f)
>> Before the second I access the first (of course) but after the
>> second local I can only access the second one?
> Yes. _During_ the second. if you had for example
>    local f = f..'a'
> or
>    local f = function(x) return f..x end
> or
>    local function f(x) return f..x end
> you would still be accessing the first.

In the third case the second f would be accessed.
What about recursive functions in Lua?  ;-)