lua-users home
lua-l archive

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



> *From:* "Jerome Vuarand" <jerome.vuarand@gmail.com>
> *To:* <myshkin@cix.co.uk>, "Lua mailing list" <lua-l@lists.lua.org>
> *Date:* Tue, 23 Oct 2012 11:30:55 +0100
 
> > I don't quite understand why the syntax of "if" can't be extended 
> > to say
> > that if it is given a list of values it tests the first one. But 
> > maybe
> > something else would graunch to a halt then.
> 
> It's already working like that. For example :
> 
> function foo()
>     return false,42
> end
> 
> if foo() then
>     print("this message is not displayed")
> else
>     print("that message is displayed")
> end
 
well blow me down... I tried things like that and the compiler didn't
like them. I'll try it again.

TVM

David