3 ms·
In C and JS assignment is an expression which returns the value being assigned. This makes the semantics of things like `a = b = 10` trivial. In Pony, though,
by klibertp 8y ago
In C and JS assignment is an expression which returns the value being assigned. This makes the semantics of things like `a = b = 10` trivial.
In Pony, though, this is averted, as the assignment there returns the old value of a variable being assigned:
var a = 10
var b: Int
b = a = 20
a == 20 and b == 10 // very true
It's a very interesting approach I wish I saw explored more often.