Skip to content

Operators

DurieuxPol edited this page Apr 11, 2024 · 7 revisions

Operators are objects that describe a type of mutation. They're like a guide on how to perform the mutation they correspond to.
Here is an array summarising all operators:

Category Operators
Deletion Empty method ; Remove at:ifAbsent: ; Remove ^ ; Remove exception handler ; Remove inject:into: ; Remove not ; Remove block for do: ; Remove second block for detect:ifNone:
Arithmetic replacement Replace * by / ; Replace / with * ; Replace + with - ; Replace - with +
Literal manipulation Negate boolean ; Increase integer ; Decrease integer ; Integer to 0 ; String replacement ; Empty string
Boolean receiver replacement Replace and: receiver with true ; Replace or: receiver with false ; Replace ifTrue: receiver with true/false ; Replace ifFalse: receiver with true/false ; Replace ifTrue:ifFalse: receiver with true/false ; Replace ifFalse:ifTrue: receiver with true/false ; Replace whileTrue: receiver with true/false ; Replace whileFalse: receiver with true/false
Clone this wiki locally