Issue 6708 in pharo: Remove BlockClosure>>once which is useless

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 6708 in pharo: Remove BlockClosure>>once which is useless

pharo
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=6708

The 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
Reply | Threaded
Open this post in threaded view
|

Re: Issue 6708 in pharo: Remove BlockClosure>>once which is useless

pharo
Updates:
        Status: FixReviewNeeded

Comment #1 on issue 6708 by [hidden email]: Remove  
BlockClosure>>once which is useless
http://code.google.com/p/pharo/issues/detail?id=6708

Name:  
SLICE-Issue-6708-Remove-BlockClosure-once-which-is-useless-DamienCassou.1
Author: DamienCassou
Time: 20 September 2012, 7:02:17.378 pm
UUID: 6e5825cb-139c-4e8d-8f46-660f95beef93
Ancestors:
Dependencies: Kernel-DamienCassou.1168, FuelTests-DamienCassou.273

- Remove BlockClosure>>once and related code. All this code is unused and  
not working anyway


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 6708 in pharo: Remove BlockClosure>>once which is useless

pharo
Updates:
        Status: FixToInclude

Comment #2 on issue 6708 by [hidden email]: Remove  
BlockClosure>>once which is useless
http://code.google.com/p/pharo/issues/detail?id=6708

looks good


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker
Reply | Threaded
Open this post in threaded view
|

Re: Issue 6708 in pharo: Remove BlockClosure>>once which is useless

pharo
Updates:
        Status: Integrated

Comment #3 on issue 6708 by [hidden email]: Remove  
BlockClosure>>once which is useless
http://code.google.com/p/pharo/issues/detail?id=6708

in 2.0 2300


_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker