TE
科技回声
首页
24小时热榜
最新
最佳
问答
展示
工作
中文
GitHub
Twitter
首页
Epic Answer - Avoiding If statements
9 点
作者
sidmkp96
大约 12 年前
3 条评论
yen223
大约 12 年前
Collapse
It's easy - use switch/case statements!<p>But seriously, isn't it true that Smalltalk doesn't have if statements?
评论 #5400431 未加载
andymoe
大约 12 年前
His idea in the second edit is similar to what is done with a lot of methods in Cocoa and Cocoa Touch and so on: <a href="http://cocoadev.com/wiki/MethodSwizzling" rel="nofollow">http://cocoadev.com/wiki/MethodSwizzling</a>
amccloud
大约 12 年前
Wouldn't that be considered a state machine? I've done something with an audio player. Each state was a different class.