On Thu, Apr 26, 2001 at 02:11:24AM +0900, bw wrote:
> [I am new to ruby]

I am quite new to ruby too, but maybe my answer (partly derived from
my perl knowledge) to one question still might satisfy you.

> As far as I have seen, RubyIO just maps to UNIX system calls.
> Maybe someone can comment on this:
> 
> * line-buffering: gets() has \n at the end
>    so that 99% of all code looks like this: gets(); chomp() (from Perl?)
>    why not doing it like Tcl, strip the EOL on input
>    and add the EOL later at output (if needed).

There are actually several reasons for this:

- You don't really need to chomp() that often. Many times one only
  applies a Regex to the line and the newline usually doesn't hurt in
  that case. ($ and \Z match before the \n)

- You might want to read binary files with gets(). Would you expect
  that they were altered too? You might also give a different
  line-separator to gets, in which case it might surprise you if it
  were removed.

- If the newline would be truncated automatically, you couldn't know,
  whether the last line in a file contained one.

BTW: Usage of real names is a widely spread common.

-- 
marko schulz

                          Dieser Satz beinhalten drei Fehller.