lua-users home
lua-l archive

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



On 26-Jan-06, at 11:19 AM, Alen Ladavac wrote:

So, I'm lead to conclusion that if you have round braces around if's condition you can pretty well have curly braces around its block without a problem. What do you think?

I think you're using Lua 4. That's not a Lua 5 error message:

rlake@freeb:~/src/lua-5.1$ lua
Lua 5.0.2  Copyright (C) 1994-2004 Tecgraf, PUC-Rio
> function a() print("a") end
> if (a){a = 1} then print "then" else print "else" end
a
else
> =loadstring"if(a) { b = 1}"
nil     [string "if(a) { b = 1}"]:1: `then' expected near `<eof>'