Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- z = condition.ifTrue { 1 + 1 }.ifFalse { 0 } # How?
- # If the result is the body of the block the ifFalse could be accidently run by
- true.ifTrue { false }.ifFalse { puts "False!" }
- # if the result is _not_ the body of the block but rather the condition, it's not an expression
- # anymore but a procedural control structure and you have to write
- condition.ifTrue { z = 1 + 1 }.ifFalse { z = 0 }
- # which is ok I suppose, but not how smalltalk works
Add Comment
Please, Sign In to add comment