does your favorite language have support for if expressions gee ?
>LuauWhy use this shit over LuaJIT?
>>107274587>LuaJITWhy use that shit over TypeScriptToLua?
>>107274607the only good thing about lua is the syntaxtheres no reason to use it like this
>>107274141sign = x<0 ? -1 : ( x>0 ? 1 : 0 );
sign = x<0 ? -1 : ( x>0 ? 1 : 0 );
>>107274946uhmm chuddy, in lua 1 is false and 2 is true, learn some common sense will you
>>107274141Rust, yes.
making everything an expression is one of the things rust got right
>>107274967meds
>>107274141Usecase? I think mixing declaration with logic is a bad idea, that is why I always avoid ternary operators in C.
>>107275065that's because you're a midwit.how do you declare and init in one shot otherwise? you don't without ternary in C.
>>107275065if expressions is just an extension to and and or operators that you can use in expressions in luau
>>107274141literally just a c ternary operator but uglier
>>107275124>uglierreadable*
>>107274587it has ternary operators
Of course, given that my favourite language is microsoft excel=IF(expression, <output if true>, <output if false>)
=IF(expression, <output if true>, <output if false>)
>>107275100>how do you declare and init in one shot otherwise?You don't.
>>107274141n-no