Re:An Opinionated Treatise on Cosmos, a New Programming Lang...
by onli on Tuesday November 18, 2014 @05:45AM
(#8623341)
I'm not sure either. But it could be a ruby style and, and a mix between assign and equal operator.
Then
(s='a' and x=0)
would mean: if s=='a' then set x to 0, but if s != 'a' he would never jump to x=0, since and does stop when the result before is falsy - it is following the logical and behaviour.
The or would prevent the x=2 to be executed when the prior block is true, one true is enough.
Then
would mean: if s=='a' then set x to 0, but if s != 'a' he would never jump to x=0, since and does stop when the result before is falsy - it is following the logical and behaviour.The or would prevent the x=2 to be executed when the prior block is true, one true is enough.