lua-users home
lua-l archive

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


[Aaron Brown <aaron-lua@oakadaptive.com>]
> me.  For instance, in the following code
> 
>   f = function() return function(s) print(s) end end
>   print f() "foo"
> 
> f gets turned into a function, but it doesn't immediately
> get called with the argument "foo".  Instead there's a parse
> error.  So obviously there's something I'm missing.
> 

Nope, you have something extra... :)

There's an extra "print"... Just doing:

  f = function() return function(s) print(s) end end
  f() "foo"

works just fine...

Matt

-- 
Matt Hellige                  matt@immute.net