Re: Flag & byLine confusion.

2020-12-20 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 20 December 2020 at 15:18:44 UTC, Rekel wrote: By the way, where can I see Flag is (/ will be?) deprecated? It doesn't show in the library reference, however I may be looking in the wrong place. It hasn't been yet.

Re: Flag & byLine confusion.

2020-12-20 Thread Rekel via Digitalmars-d-learn
On Sunday, 20 December 2020 at 15:04:29 UTC, Steven Schveighoffer wrote: On 12/20/20 9:07 AM, Rekel wrote: Does this mean other flag yes's will not be accepted? The long and short of it is that Flag is supposed to make you NAME what your flag is for. The idea is to prevent things like:

Re: Flag & byLine confusion.

2020-12-20 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/20/20 9:07 AM, Rekel wrote: Does this mean other flag yes's will not be accepted? The long and short of it is that Flag is supposed to make you NAME what your flag is for. The idea is to prevent things like: byLine(true); Reading the code, what does "true" mean? You have to look up

Re: Flag & byLine confusion.

2020-12-20 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 20 December 2020 at 14:07:56 UTC, Rekel wrote: The template parameter serves to make Flag!"foo" a distinct type from Flag!"bar". Does this mean other flag yes's will not be accepted? Yes. https://dlang.org/spec/operatoroverloading.html#dispatch Also regarding the other

Re: Flag & byLine confusion.

2020-12-20 Thread Rekel via Digitalmars-d-learn
Thanks for all the help! This makes it make a lot more sense now, I'm surprised it's not part of the dlang tour. The template parameter serves to make Flag!"foo" a distinct type from Flag!"bar". Does this mean other flag yes's will not be accepted?

Re: Flag & byLine confusion.

2020-12-19 Thread Ali Çehreli via Digitalmars-d-learn
On 12/19/20 4:40 PM, Mike Parker wrote: >> 1. Yes.keepTerminator > > This is because of Yes is a struct with an opDispatch template that > "forwards" to Flag!"keepTerminator".yes. This is the preferred syntax > and will work with any Flag parameter. I use Flag a lot but I am always bugged by

Re: Flag & byLine confusion.

2020-12-19 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 19 December 2020 at 23:16:00 UTC, Rekel wrote: Most confusing was the way the documentation (website & in-editor) used; 1. Yes.keepTerminator 2. KeepTerminator.yes 3. Flag!"keepTerminator".yes Your confusion arises from the fact that KeepTerminator is combining multiple

Re: Flag & byLine confusion.

2020-12-19 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 19 December 2020 at 23:16:00 UTC, Rekel wrote: After reading most of the tour.dlang.org website, I was completely surprised & confused encountering 'KeepTerminator', a 'Flag' used by the File.byLine function. With no examples denoting how to use it. Most confusing was the way

Flag & byLine confusion.

2020-12-19 Thread Rekel via Digitalmars-d-learn
After reading most of the tour.dlang.org website, I was completely surprised & confused encountering 'KeepTerminator', a 'Flag' used by the File.byLine function. With no examples denoting how to use it. Most confusing was the way the documentation (website & in-editor) used; 1.