Status: Accepted
Owner:
[hidden email]
CC:
[hidden email],
[hidden email]
Labels: Type-Cleanup Milestone-2.0 Importance-Low Difficulty-Easy
New issue 6708 by
[hidden email]: Remove BlockClosure>>once which is
useless
http://code.google.com/p/pharo/issues/detail?id=6708The idea behind BlockClosure>>once is to write code like this:
foo
^[expression] once.
so that you can call #foo many times and expression is only computed once.
This would work very well if blocks would be real objects stored in the
method. But this is not the case, blocks are recreated each time the method
is executed. Which means #once used like that is exactly similar to #value.
One way to make use of #once would be to write something like:
foo
^ (b ifNil: [b := [Transcript show: 'foo'. 3]]) once
with b an instance variable. But then, what is the benefits compared to
implementing the caching manually?
There is not a single user of this method. Please remove it.
_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker