In the SC4 speculation thread, there are understandably a lot of gripes about the old-fashioned or weaker elements in sclang’s design, but it does have a kind of purity about it that I find appealing.
; isn’t a statement terminator as in C because SC has no statements, only var/arg declaration blocks and expressions. If you’re used to C style languages, you’ll think, “Yeah but they’re really statements,” but they’re not – if it’s not declaring a var or arg, then it’s an expression, period. It has a value. a = stream.next is an expression whose return value is the right hand side and whose side effect is to update a. It is not an “assignment statement.” So you can do, for instance,
f = { arg stream;
var ch;
while {
(ch = stream.next).notNil and: { ch != $\n }
} {
... loop body...
};
};
… because the expression ch = stream.next can appear anywhere an expression is valid.
I’ve gotten away from this style, for clarity, but it’s legal.
(Similarly, SC doesn’t have control structures. If, while, case, switch, do etc are all methods. Nor does it have any operators – binary ops in infix notation compile to method calls – so there’s no special handling for operator overloading.)