Why is there no switch statement?
By Paolo Bonzini - Posted on June 25th, 2007
Well, various syntaxes have been proposed along the years, but no one was really satisfying.
There are many alternatives:
- You can use #ifTrue:ifFalse: repeatedly.
- You can create a dictionary or, in more complex cases, a dictionary of blocks
- You can use polymorphism