[Newbies] another "best practices" question - inject
mark at ociweb.com
Sun Nov 2 20:54:39 UTC 2008
The "Inject:Into:" pattern in "Smalltalk Best Practice Patterns" says
"Call the block arguments sum and each." That seems crazy! Why would I
name the first argument "sum" if I've trying to do something other
than sum the values? The example the book gives is the following.
into: [:sum :each | sum max: each]
I think I'd do this.
into: [:maximum :each | maximum max: each]
More information about the Beginners