lua-users home
lua-l archive

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


On Wed, Jan 10, 2001 at 08:57:29PM +0000, Reuben Thomas wrote:
> Some things that came up in a bout of hacking over Christmas:
> 
> 1. Why can't inner functions be defined for local values? I mean that:
> 
> function y ()
>   function f() ...
>   end
> end
> 
> works, but
> 
> function y ()
>   local f = function g()
>               function h()
> 	      end
> 	    end
> end
> 

Check out The Complete Syntax of Lua in the back of the Lua manual and you'll
see that you need to delete the 'g', like so

  function y ()
    local f = function()
                function h()
  	      end
  	    end
  end


Cheers,

- Peter