User avatar
pathetic piss kitten @kitten@elizabeth.cat
1d
my archenemy, nested ternary operators
3
1
3
0
User avatar
Erin 💽✨ @erincandescent@erincandescent.net
1d
@kitten you would hate your average (System)Verilog file, its practically standard to write things like
assign x = condition_a ? foo :
           condition_b ? bar :
           condition_c ? baz :
           condition_d ? qux :
                         quux;
2
0
0
0
User avatar
Daphne Preston-Kendal @dpk@chaos.social
1d
@erincandescent @kitten So you know how they came out with a JS edition of SICP recently

Yeah, well, the original Scheme version has a section that depends heavily on ‘if’ and ‘cond’ being expressions and not statements. JS ‘if’ is a statement and can’t be used in a context that expects a value.

… how do you think they solved this 😬

sourceacademy.org/sicpjs/1.1.6
1
0
0
0
User avatar
pathetic piss kitten @kitten@elizabeth.cat
1d
@dpk @erincandescent neocat_cry
0
0
0
0