2008/11/10 Marcus Denker <denker@iam.unibe.ch>:
On 10.11.2008, at 15:56, Marcus Denker wrote:
On 10.11.2008, at 15:42, Igor Stasenko wrote:
2008/11/10 Marcus Denker <denker@iam.unibe.ch>:
- ifNotNilDo: calls renamed to ifNotNil:
does it means that #ifNotNil: now accepts monadic blocks? If yes, then cool :)
Yes. And it optimizes them even, same like ifNotNil: without an argument.
This was done by Vassili Bykov
Right, it was written at the same time, when i reported it more than a year ago :) http://bugs.squeak.org/view.php?id=6426 i'm glad, that this isssue finally will be harvested. Looking back, it is not very important, but more like aesterically right and logical one. Needless to say it helps write more concise code. i avoid using #ifNotNilDo: , but surely i'm using #ifNotNil: but only with niladic blocks because of this issue.
The only problem remaining is that the decompiler does not decompile it correctly...
Smalltalk ifNotNil: [:each | 1 + 4]
is decompiles to:
tt | each | (each := Smalltalk) ifNotNil: [1 + 4]
So the decompiler needs to be enhanced to be a bit cleverer. (I will add a bug-report for that).
Marcus
-- Marcus Denker -- denker@iam.unibe.ch http://www.iam.unibe.ch/~denker
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.