1

Closed

IO.readline does not take account of the optional separator

description

In IR 1.0, IO.readline does not take account of the optional parameter that is supposed to be the line separator.
IO.gets on the other hand does.
 
My copy of Programming Ruby says:
 
readline io.readline( separator=$/ )→ string
Reads a line as with IO#gets, but raises an EOFError on end of file.
 
I've checked all other Ruby flavours, and they all act as expected.
 
Interestingly, RubySpec tests the separator on gets, but not readline.
Closed Jul 28, 2011 at 3:40 PM by jimmysch
Readline passes the separator along to a call to "gets", and if the result of "gets" is null it throws an EOFError exception.https://github.com/IronLanguages/main/blob/master/Languages/Ruby/Libraries/Builtins/IoOps.cs#L947

comments