[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: converting lua functions to strings
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 26 Nov 2002 09:17:20 +0000
> Speaking of functions as first class, is there any reason why the
> following doesn't work (I'm using 4.0 alpha):
>
> function(x) return x end ("foo")
Because the parser cannot understand that (the old problem with optional
semicolons...). In Lua 5.0, you can write that adding parentheses:
(function(x) return x end) ("foo")
-- Roberto