Skip to content

Operators

DurieuxPol edited this page Apr 12, 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 argument for do: | Remove second block argument 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
Logical boolean operation Replace and: receiver with true | Replace or: receiver with false | Replace and: argument with true | Replace or: argument with false | Replace obj and: block with false | Replace obj or: block with true | Replace and: with ==/nand:/or: | Replace or: with xor:/and:
Conditional boolean operation 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 | Replace ifTrue:/ifFalse: with ifFalse:/ifTrue: | Replace whileTrue:/whileFalse: with whileFalse:/whileTrue:
Relational operation Replace =/~= with ~=/= | Replace (a == b) with (a == b) not | Replace </> with >/< | Replace >= with =/> | Replace <= with =/</>/true | Replace max:/min: with min:/max:
Clone this wiki locally