Re: Should D file end with newline?

2019-02-16 Thread sarn via Digitalmars-d-learn
On Friday, 15 February 2019 at 13:14:47 UTC, Patrick Schluter wrote: A lots of fgets() based tools on Unix systems fail to read the last line if it doesn't contain a line feed character at the end. Afaicr glibc implementation does not have that problem but a lot of other standard C libs do.

Re: Should D file end with newline?

2019-02-15 Thread Patrick Schluter via Digitalmars-d-learn
On Wednesday, 13 February 2019 at 05:13:12 UTC, sarn wrote: On Tuesday, 12 February 2019 at 20:03:09 UTC, Jonathan M Davis wrote: So, I'd say that it's safe to say that dmd The whole thing just seems like a weird requirement that really shouldn't be there, Like I said in the first reply,

Re: Should D file end with newline?

2019-02-12 Thread sarn via Digitalmars-d-learn
On Tuesday, 12 February 2019 at 20:03:09 UTC, Jonathan M Davis wrote: So, I'd say that it's safe to say that dmd The whole thing just seems like a weird requirement that really shouldn't be there, Like I said in the first reply, FWIW, it's a POSIX requirement. Turns out most tools don't care

Re: Should D file end with newline?

2019-02-12 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, February 12, 2019 4:45:43 AM MST Jacob Carlborg via Digitalmars- d-learn wrote: > On 2019-02-10 18:20, Jonathan M Davis wrote: > > I use (g)vim, which I would expect to show anything like trailing > > newlines. It usually shows everything, including rendering control > > characters and

Re: Should D file end with newline?

2019-02-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-02-10 18:20, Jonathan M Davis wrote: I use (g)vim, which I would expect to show anything like trailing newlines. It usually shows everything, including rendering control characters and the like in a way that you know exactly what's there. Opening up std/algorithm/mutation.d in vim as an

Re: Should D file end with newline?

2019-02-10 Thread Jonathan M Davis via Digitalmars-d-learn
gt;> ISO C++ specifies that the C++ file must end with a newline. > >> > >> Should D file end with newline, too? > > > > No, there is no need to end D files with a newline. I would > > guess that the vast majority of D files end with a closing > > bra

Re: Should D file end with newline?

2019-02-10 Thread Benjamin Schaaf via Digitalmars-d-learn
On Sunday, 10 February 2019 at 02:12:43 UTC, Jonathan M Davis wrote: On Saturday, February 9, 2019 2:19:27 PM MST Victor Porton via Digitalmars- d-learn wrote: ISO C++ specifies that the C++ file must end with a newline. Should D file end with newline, too? No, there is no need to end D

Re: Should D file end with newline?

2019-02-10 Thread Cym13 via Digitalmars-d-learn
On Sunday, 10 February 2019 at 02:12:43 UTC, Jonathan M Davis wrote: On Saturday, February 9, 2019 2:19:27 PM MST Victor Porton via Digitalmars- d-learn wrote: ISO C++ specifies that the C++ file must end with a newline. Should D file end with newline, too? No, there is no need to end D

Re: Should D file end with newline?

2019-02-09 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, February 9, 2019 2:19:27 PM MST Victor Porton via Digitalmars- d-learn wrote: > ISO C++ specifies that the C++ file must end with a newline. > > Should D file end with newline, too? No, there is no need to end D files with a newline. I would guess that the vast majority o

Re: Should D file end with newline?

2019-02-09 Thread sarn via Digitalmars-d-learn
On Saturday, 9 February 2019 at 21:19:27 UTC, Victor Porton wrote: ISO C++ specifies that the C++ file must end with a newline. Should D file end with newline, too? I'm sure you could mostly get away without one, but POSIX says that all text files should end with a newline. There are some

Should D file end with newline?

2019-02-09 Thread Victor Porton via Digitalmars-d-learn
ISO C++ specifies that the C++ file must end with a newline. Should D file end with newline, too?