How about leaving readline as it now is and defining readln() to be 
chomp(readline())?



On Saturday, April 12, 2014 4:26:48 PM UTC-7, Jeff Waller wrote:
>
>
>
> On Saturday, April 12, 2014 6:02:44 PM UTC-4, Stefan Karpinski wrote:
>>
>> Making STDIN consistently the default input stream and STDOUT 
>> consistently the default output stream is right – any inconsistency there 
>> is just an oversight. Could you open an issue? I don't care for the 
>> renaming to readln myself. I've often considered the idea that lines should 
>> be chomped by default but there is something really nice about the fact 
>> that you can just print all the lines you get and the output is identical 
>> to the input.
>>
>
> Oh man, reaction!  I've answered below, also, what do you think of the 
> idea?
>
> ##Behavior of readlines
>
> Make issue? sure can;  [like this?](
> https://github.com/JuliaLang/julia/issues/6511) 
>
> ##readline vs. readln
> Seems like a lot asking for just 2 characters or even talking about it. 
>  It does make a difference though; It does distinguish Julia from other 
> languages.  Does it need those 2 letters?  It does feel clearer, but at 
> what expense?  I'm not sure actually. But consider *JQuery*'s ***$***. 
>  it's just an alias for ****jquery***; the sole reason for its existence is 
> so people don't have to type 5 extra letters.  But then, that's 5 letters, 
> not 2, and it so many people use JQuery, it saves thousands of man-hours.
>
> ##readline returning '\n'
> It's interesting, but, In my experience so far, this is just cumbersome. 
>  Almost always you want ***chomp(readline())*** especially in the context 
> of ***readline*** where the expectation is read a *line* of input where a 
> *line* is defined as all of those characters delimited by '\n'.  From the 
> compactness perspective, the *read a line* idiom is an extra function call 
> ***chomp*** and 7 characters more than it would otherwise be if the 
> situation were reversed.
>

Reply via email to