[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: why won't ruby chomp for me?
From:       Emmanuel Touzery <emmanuel.touzery () wanadoo ! fr>
Date:       2004-01-29 18:36:12
Message-ID: 200401291931.14790.emmanuel.touzery () wanadoo ! fr
[Download RAW message or body]

Hello,

>One problem with "autochomping" is that at the end of file you don't
>know if the record (line) ended "properly" or whether the read ended
>because of an end of file.

so this is why so many tools insist on a final carriage return at the end of a 
file? in the case of a truncated file? i never quite got it :O)

> In your example above, if the newline was removed by <>, would you
> expect the print to put it back? But print doesn't do that, and
> shouldn't, what if you want to do two prints to build up a single line!

i'm satisfied of the distinction between puts and print :O)

generally, i think it's a good design decision, but i have a bit the feeling 
the particular case killed the general case (when you don't care about that). 
but i agree that uniformity pays off, and this is definitely very good that 
it's not "half of the methods give the \n, half don't". and since sometimes 
it's needed...

thanks for all the very clear answers :O)

PS: somehow i many times though that Guy meant "Pascal" when he mentionned 
"the P language" ;O)

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic