From ruby-talk Thu Jan 29 18:36:12 2004 From: Emmanuel Touzery Date: Thu, 29 Jan 2004 18:36:12 +0000 To: ruby-talk Subject: Re: why won't ruby chomp for me? Message-Id: <200401291931.14790.emmanuel.touzery () wanadoo ! fr> X-MARC-Message: https://marc.info/?l=ruby-talk&m=107540140907799 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)