RosettaCodeData/Task/Extend-your-language/Smalltalk/extend-your-language-4.st

8 lines
212 B
Smalltalk

If2 class method:
when:cond1 or:cond2 ifBoth:both ifFirst:first ifSecond:scnd ifNone:none
^ cond1 ifTrue:[
cond2 ifTrue:both ifFalse:first
] ifFalse:[
cond2 ifTrue:scnd ifFalse:none
]