5 "Boolean-conditional evaluation."
6 _@True ifTrue: block ifFalse: _ [block do].
7 _@False ifTrue: _ ifFalse: block [block do].
9 bool@(Boolean traits) ifTrue: block
10 "Some sugaring for ifTrue:ifFalse:."
12 bool ifTrue: block ifFalse: []
15 bool@(Boolean traits) ifFalse: block
16 "Some sugaring for ifTrue:ifFalse:."
18 bool ifTrue: [] ifFalse: block
21 "Logical AND and OR. This works by having True and False be children of
24 _@True /\ _@True [True].
25 _@(Boolean traits) /\ _@(Boolean traits) [False].
26 _@False \/ _@False [False].
27 _@(Boolean traits) \/ _@(Boolean traits) [True].
29 "Boolean Equivalence."
30 x@(Boolean traits) eqv: y@(Boolean traits) [x == y].
32 "Boolean Exclusive OR."
33 x@(Boolean traits) xor: y@(Boolean traits) [x eqv: y not].
35 "Implication (not entailment)."
36 x@(Boolean traits) --> y@(Boolean traits) [x not \/ y].
38 bool@(Boolean traits) and: block
39 "Conditional AND, but it can return the value of the block."
40 [bool ifTrue: block ifFalse: [False]].
42 bool@(Boolean traits) or: block
43 "Conditional OR, but it can return the value of the block."
44 [bool ifTrue: [True] ifFalse: block].
46 bool@(Boolean traits) and: x and: y
48 [(bool and: x) and: y].
50 bool@(Boolean traits) and: x and: y and: z
52 [((bool and: x) and: y) and: z].
54 bool@(Boolean traits) or: x or: y
58 bool@(Boolean traits) or: x or: y or: z
60 [((bool or: x) or: y) or: z].
62 "Administrative/prettying methods:" (
63 _@True printName ['True'].
64 _@False printName ['False'].