lua-users home
lua-l archive

Re: help with lua style and syntax

[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:* 2012年10月23日 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

AltStyle によって変換されたページ (->オリジナル) /