Re: Tutorial

Peter Bortas <[email protected]>
Newsgroups gmane.comp.lang.pike.user
Message-ID <CA+NK+ADL4iC7ER30Pq1TZ6mz-YBsHtrhUpPXDNz0Y33_PybmdQ@mail.gmail.com>
On Thu, Dec 8, 2016 at 11:33 PM, Chris Angelico <[email protected]> wrote:
> On Fri, Dec 9, 2016 at 9:22 AM, Peter Bortas <[email protected]> wrote:
>>> Would it break the API? I mean, conceptually, it's retrieving a string
>>> terminated by end-of-line. On Windows, "end-of-line" is often "\r\n".
>>> Perhaps the solution is for gets to always strip off a trailing \r?
>>> Bear in mind that this also applies to files that have CRLF endings,
>>> not just stdin. I normally get around it by trimming whites, but it'd
>>> be nice for it to just work.
>>
>> It would not break the documented API, but it would change what gets()
>> returns on all OS. Maybe someone somewhere is feeding gets() with
>> deliberate \r's at the end. To clarify: I am argumenting for breaking
>> it though. Maybe even before 8.2.
>
> Gotcha. Yeah, I understand that this shouldn't be changed in 8.0, just
> because it is an incompatibility. But it's fulfilling the concept of
> the function, so yep, change it in 8.1 IMO.

With before 8.2 I meant potentially in 8.0. :)

Reason being I can come up with plausible (but stupid) scenarios where
this could break something, but gets is a silly function that never
gets used except in the tutorial. Having a working tutorial is good.

Or we fix the tutorial. With say, Readline? (Please Readline, don't be
broken on Windows...)

-- 
Peter Bortas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.