Talk:IfElse: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 8: Line 8:


in C++.
in C++.
----
oO You're right. Never thought of that. What I was thinking about, too, was something like
<syntaxhighlight lang="lua">moo = ({ [true] = ifTrue, [false] = ifFalse })[condition]</syntaxhighlight>
But your code is much better. Thanks for posting this. ;D [[User:NeonBlack|NeonBlack]] 22:00, 18 May 2009 (CEST)

Revision as of 20:00, 18 May 2009

There's not really any use for this, as far as i can tell. Lua supports this by its syntax sugars:

moo = (variable) and (ifTrue) or (ifFalse)

works the same as

moo = (varible) ? ifTrue : ifFalse

in C++.


oO You're right. Never thought of that. What I was thinking about, too, was something like

moo = ({ [true] = ifTrue, [false] = ifFalse })[condition]

But your code is much better. Thanks for posting this. ;D NeonBlack 22:00, 18 May 2009 (CEST)