OK, the use of "-" inside the CAT lambda I could perhaps tolerate. But 
in the invocation I think it looks silly. Now, I tried something crufty 
instead that happens to work!?!:

CAT = lambda do |*args|
  lambda do |io_in, io_out|
    io_in.each_line {|line| line.chomp!; io_out.puts line} unless 
io_in.inspect =~ /STDIN/

    args.each do |file|
      File.foreach(file) {|line| io_out.puts line}
    end
  end
end

p = Pipe.new
p << CAT["table.txt"]
p << CAT["foo.tab"]
p << lambda {|r,w| r.each {|x| puts x}}
p.execute_processes

One could perhaps patch class IO and add a stdin? method?


Cheers,


Martin

-- 
Posted via http://www.ruby-forum.com/.