Hacker News new | ask | show | jobs
by oezi 249 days ago
Certainly possible: add ifTrue as a method to TrueClass and FalseClass.

It just isn't very fast.

1 comments

problem is not with ifTrue, and not with it's performance, it's easy to do. it is "ifTrue:ifFalse:"

also it is common to do assignments in the "if", and with actual method and blocks scope of the introduced variable would be different and everyone would be tripping on it all the time.