Re:Statements vs. Expressions
by FeepingCreature on Saturday July 16, 2022 @05:04AM
(#32116343)
Lotta CPU time spent to get you that nil.
One would think you could just `(defun fun () nil)`.
There seems to be a disagreement about what an expression is.
I have the impression that you think that an expression is a way to compute a value, while I would posit that an expressions are a method of combining values.
Not really an expression:
a0 = 1;
a1 = f(2);
if (a0 < a1){
a2 = getInput();
} else {
a2 = 3;
}
result = a0 + a1 + a2;
More of an expression: result = 1 + f(2) + (a0 < a1 ? getInput() : 3);
nil.
The fact that you can syntactically put loops and ifs in place of expressions is what makes them expressions