[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LFM + LFSP = LFE?



> From:  Grzegorz =?utf-8?q?Chrupa=C5=82a?= <grzegorz@pithekos.net>
> Subject:  Re: LFM + LFSP = LFE?
> On Thu 12 Jun 2003 22:54, Steven Grady wrote:
> 
> > iteration over multiple Enumerables.  A variation on map that supported
> > indefinitely large objects (e.g. I/O streams) would be very awkward --
> > the implementation would require threads or continuations.
> 
> I agree with most everything you say, except the above statement which 
> puzzled me.
> Would this:
> 
> File.new("file").map{|line| line.reverse}
> 
> qualify as a "variation on map" that supports I/O streams? Or do you have 
> something else in mind?

I was referring to open streams, so you couldn't pull in the
entire thing at once.  So mapping the block
    {|s1,s2| s1+s2}
on each line of characters coming over two separate sockets is
kind of hard.  The reason I referred to a "variation" on map is
that map doesn't have any termination conditions, other than its
inputs terminating, but for the function to work on streams, it
would have to have a reason to terminate.

	Steven
"Hey, stewardess.  Run through that seatbelt demonstration
a few more times.  It's unbelievably tricky!"