[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


Janitor application acceptance emails are being sent out. Please remember to check your spam box!


[Advertise on 4chan]


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

=IF(expression, <output if true>, <output if false>)
>>
>>107275100
>how do you declare and init in one shot otherwise?
You don't.
>>
File: 1745793887723013.jpg (331 KB, 987x1200)
331 KB
331 KB JPG
>>107274141
n-no



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.