2 ms·
It may be I'm missing something here. Do we really need to tack block handling onto every method that can change some state? I don't see any benefit over the fo
by radiowave 13y ago
It may be I'm missing something here. Do we really need to tack block handling onto every method that can change some state? I don't see any benefit over the following idiomatic Smalltalk:
(self dataSource getPersonById: id) ifNotNil: [:person |
"operate on person here"
].
(There's also ifNil:ifNotNil: for where you want to handle both cases.)