>>10
Not sure what you're trying to say there, but I'll take if-as-expression over if-as-statement any day.
Name:
Anonymous2012-09-30 21:42
>>11
An instruction set is said to be orthogonal if it lacks redundancy (i.e. there is only a single instruction that can be used to accomplish a given task)[8] and is designed such that instructions can use any register in any addressing mode. This terminology results from considering an instruction as a vector whose components are the instruction fields. One field identifies the registers to be operated upon, and another specifies the addressing mode. An orthogonal instruction set uniquely encodes all combinations of registers and addressing modes.[citation needed]
C's if cannot be used as an expression and the ternary operator requires both results to have the same type. Therefore, the only way to emulate Lisp's if is to wrap most expressions into a common Lisp object structure.
the ternary operator requires both results to have the same type.
That's necessary for it to be an expression. What would be the type of the expression if the two branches returned different types?