On 06.12.2006 18:37, Trans wrote:
> ara.t.howard / noaa.gov wrote:
> 
>> method + state => object

I would have put it differently: command pattern.  Your method seems 
pretty complex so you can change it into a command object.  If the 
problem at hand is complex then it probably needs a complex solution. 
But I would not go down the metaprogramming route.

> good point. though it moves me away from the simplicity of single call.
> also i wonder about things like String#each. the global default for
> separator is not really the ideal implementation, but #each can't be
> made a class.

Really?

 >> require 'enumerator'
=> true
 >> %w{foo bar baz}.to_enum(:each)
=> #<Enumerable::Enumerator:0x3a6b00>

Cheers

	robert