jmichel / schur.institut.math.jussieu.fr wrote:

> On another topic, is there a way in ruby to have a string behave as a file
> (something like the 'istringstrem' class of C++ ?)

There was a discussion of this a few weeks ago. 
Since Ruby is dynamically typed, Strings and 
Files can behave the same (and thus be 
interchangable) even if they do not inherit from 
each other.

For eample:

  stream.each_line do
	| line |
	puts ">" + line
  end

This will work whether stream is a File or a 
String. If there are other operations that you 
would like String to support (like lineno or 
seek) you would just have to create a subclass of 
String that implements those methods.

This should definitely go in the FAQ.

Kevin