Thomas S?ndergaard <tsondergaard / speakanet.com> writes:

>> > I would probably just use:
>> 
>> [...]
>> 
>> >   istream.each { |line|
>> >       ostream.write line
>> >   }
>> 
>> Agreed.  Or a bit more efficient:
>> 
>> while buf = istream.read(4096)
>>   ostream.write(buf)
>> end
>
> You're not thinking declaratively ;-) I want to say what I want it
> to do. Not how to do it.
>
> ostream << istream
>
> seems about right to me.

Sure, you're talking API and I'm talking implementation.  Your IO#<<
could be implemented with the while loop.

-- 
matt