5 ms·
Certainly possible: add ifTrue as a method to TrueClass and FalseClass. It just isn't very fast.
by oezi 1y ago
Certainly possible: add ifTrue as a method to TrueClass and FalseClass.
It just isn't very fast.
- codesnik 1y agoproblem 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.