chain operator ::
Last updated at 5:47 pm UTC on 12 September 2017
Implemented in Cuis, not in Squeak (yet).
Andres Valloud via Cuis-dev
Tue, Sep 12, 2017 at 5:13 PM
Reply-To: email@example.com, Discussion of Cuis Smalltalk
To: Discussion of Cuis Smalltalk
Cc: Andres Valloud
The chain operator "::" is a cousin of the cascade operator ";". You can think of it as "the receiver of the next message is the result of the expression to the left", as if you had used parentheses. So, for example,
1 = 1
:: and: [2 = 2]
:: and: [3 = 3]
:: ifTrue: ['ship it'] ifFalse: ['rather not']
This was introduced in Cuis circa September 2014. For a sample good argument in favor, see:
Personally, I find the chain operator very convenient to do math. Likely this is why you're seeing the notation in ParkMiller88Random.