Re: More fun with autodecoding

2018-09-16 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 09/15/2018 04:29 PM, Jonathan M Davis wrote: Adding any sort of Concepts feature to D would be very much at odds with DbI. I'm not very familiar with C++'s attempted approaches to concepts, so maybe we're thinking of two different things by "concepts", but I don't see why it would be at o

Re: More fun with autodecoding

2018-09-15 Thread Jonathan M Davis via Digitalmars-d
On Saturday, September 15, 2018 9:31:00 AM MDT Steven Schveighoffer via Digitalmars-d wrote: > On 9/13/18 3:53 PM, H. S. Teoh wrote: > > On Thu, Sep 13, 2018 at 06:32:54PM -0400, Nick Sabalausky (Abscissa) via Digitalmars-d wrote: > >> On 09/11/2018 09:06 AM, Steven Schveighoffer wrote: > >>> The

Re: More fun with autodecoding

2018-09-15 Thread Steven Schveighoffer via Digitalmars-d
On 9/15/18 12:04 PM, Neia Neutuladh wrote: On Saturday, 15 September 2018 at 15:31:00 UTC, Steven Schveighoffer wrote: The problem I had was that it wasn't clear to me which constraint was failing. My bias brought me to "it must be autodecoding again!". But objectively, I should have examined a

Re: More fun with autodecoding

2018-09-15 Thread Neia Neutuladh via Digitalmars-d
On Saturday, 15 September 2018 at 15:31:00 UTC, Steven Schveighoffer wrote: The problem I had was that it wasn't clear to me which constraint was failing. My bias brought me to "it must be autodecoding again!". But objectively, I should have examined all the constraints to see what was wrong. A

Re: More fun with autodecoding

2018-09-15 Thread Steven Schveighoffer via Digitalmars-d
On 9/13/18 3:53 PM, H. S. Teoh wrote: On Thu, Sep 13, 2018 at 06:32:54PM -0400, Nick Sabalausky (Abscissa) via Digitalmars-d wrote: On 09/11/2018 09:06 AM, Steven Schveighoffer wrote: Then I found the true culprit was isForwardRange!R. This led me to requestion my sanity, and finally realized

Re: More fun with autodecoding

2018-09-13 Thread H. S. Teoh via Digitalmars-d
On Thu, Sep 13, 2018 at 06:32:54PM -0400, Nick Sabalausky (Abscissa) via Digitalmars-d wrote: > On 09/11/2018 09:06 AM, Steven Schveighoffer wrote: > > > > Then I found the true culprit was isForwardRange!R. This led me to > > requestion my sanity, and finally realized I forgot the empty > > func

Re: More fun with autodecoding

2018-09-13 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 09/11/2018 09:06 AM, Steven Schveighoffer wrote: Then I found the true culprit was isForwardRange!R. This led me to requestion my sanity, and finally realized I forgot the empty function. This is one reason template-based interfaces like ranges should be required to declare themselves as

Re: More fun with autodecoding

2018-09-12 Thread jmh530 via Digitalmars-d
On Wednesday, 12 September 2018 at 12:45:15 UTC, Nicholas Wilson wrote: Overloads: [snip] Good point.

Re: More fun with autodecoding

2018-09-12 Thread Nicholas Wilson via Digitalmars-d
On Tuesday, 11 September 2018 at 14:58:21 UTC, jmh530 wrote: Is there any reason why this is not sufficient? [1] https://run.dlang.io/is/lu6nQ0 Overloads: https://run.dlang.io/is/m5HGOh The static asserts being in the constraint affects the template candidacy viability. Being in the functio

Re: More fun with autodecoding

2018-09-12 Thread Steven Schveighoffer via Digitalmars-d
On 9/11/18 7:58 AM, jmh530 wrote: Is there any reason why this is not sufficient? [1] https://run.dlang.io/is/lu6nQ0 That's OK if you are the only one defining S. But what if float is handled elsewhere? -Steve

Re: More fun with autodecoding

2018-09-11 Thread jmh530 via Digitalmars-d
On Tuesday, 11 September 2018 at 02:00:29 UTC, Nicholas Wilson wrote: [snip] https://github.com/dlang/DIPs/pull/131 will help narrow down the cause. I like it, but I worry people would find multiple ifs confusing. The first line of the comment is about using static asserts and in contracts,

Re: More fun with autodecoding

2018-09-11 Thread Nicholas Wilson via Digitalmars-d
On Tuesday, 11 September 2018 at 13:08:46 UTC, Steven Schveighoffer wrote: On 9/10/18 7:00 PM, Nicholas Wilson wrote: On Monday, 10 September 2018 at 20:44:46 UTC, Andrei Alexandrescu wrote: On 9/10/18 12:46 PM, Steven Schveighoffer wrote: On 9/10/18 8:58 AM, Steven Schveighoffer wrote: I'll h

Re: More fun with autodecoding

2018-09-11 Thread Steven Schveighoffer via Digitalmars-d
On 9/10/18 7:00 PM, Nicholas Wilson wrote: On Monday, 10 September 2018 at 20:44:46 UTC, Andrei Alexandrescu wrote: On 9/10/18 12:46 PM, Steven Schveighoffer wrote: On 9/10/18 8:58 AM, Steven Schveighoffer wrote: I'll have to figure out why my specialized range doesn't allow splitting based on

Re: More fun with autodecoding

2018-09-11 Thread Steven Schveighoffer via Digitalmars-d
On 9/10/18 1:44 PM, Andrei Alexandrescu wrote: On 9/10/18 12:46 PM, Steven Schveighoffer wrote: On 9/10/18 8:58 AM, Steven Schveighoffer wrote: I'll have to figure out why my specialized range doesn't allow splitting based on " ". And the answer is: I'm an idiot. Forgot to define empty :) Als

Re: More fun with autodecoding

2018-09-10 Thread Nicholas Wilson via Digitalmars-d
On Monday, 10 September 2018 at 20:44:46 UTC, Andrei Alexandrescu wrote: On 9/10/18 12:46 PM, Steven Schveighoffer wrote: On 9/10/18 8:58 AM, Steven Schveighoffer wrote: I'll have to figure out why my specialized range doesn't allow splitting based on " ". And the answer is: I'm an idiot. For

Re: More fun with autodecoding

2018-09-10 Thread Andrei Alexandrescu via Digitalmars-d
On 9/10/18 12:46 PM, Steven Schveighoffer wrote: On 9/10/18 8:58 AM, Steven Schveighoffer wrote: I'll have to figure out why my specialized range doesn't allow splitting based on " ". And the answer is: I'm an idiot. Forgot to define empty :) Also my slicing operator accepted ints and not siz

Re: More fun with autodecoding

2018-09-10 Thread Steven Schveighoffer via Digitalmars-d
On 9/10/18 8:58 AM, Steven Schveighoffer wrote: I'll have to figure out why my specialized range doesn't allow splitting based on " ". And the answer is: I'm an idiot. Forgot to define empty :) Also my slicing operator accepted ints and not size_t. -Steve

Re: More fun with autodecoding

2018-09-10 Thread Steven Schveighoffer via Digitalmars-d
On 9/8/18 8:36 AM, Steven Schveighoffer wrote: On 8/9/18 2:44 AM, Walter Bright wrote: On 8/8/2018 2:01 PM, Steven Schveighoffer wrote: Here's where I'm struggling -- because a string provides indexing, slicing, length, etc. but Phobos ignores that. I can't make a new type that does the same t

Re: More fun with autodecoding

2018-09-10 Thread Steven Schveighoffer via Digitalmars-d
On 9/8/18 8:36 AM, Steven Schveighoffer wrote: I'll work on adding some issues to the tracker, and potentially doing some PRs so they can be fixed. https://issues.dlang.org/show_bug.cgi?id=19238 https://github.com/dlang/phobos/pull/6700 -Steve

Re: More fun with autodecoding

2018-09-10 Thread Steven Schveighoffer via Digitalmars-d
On 9/10/18 1:45 AM, Chris wrote: After a while your code will be cluttered with absurd stuff like this. `.byCodeUnit`, `.byGrapheme`, `.array` etc. Due to my experience with `splitter` et. al. I tried to create my own parser to have better control over every step. I considered that, but I'm

Re: More fun with autodecoding

2018-09-10 Thread Jonathan M Davis via Digitalmars-d
On Monday, September 10, 2018 2:45:27 AM MDT Chris via Digitalmars-d wrote: > After a while your code will be cluttered with absurd stuff like > this. `.byCodeUnit`, `.byGrapheme`, `.array` etc. Due to my > experience with `splitter` et. al. I tried to create my own > parser to have better control

Re: More fun with autodecoding

2018-09-10 Thread Chris via Digitalmars-d
On Saturday, 8 September 2018 at 15:36:25 UTC, Steven Schveighoffer wrote: On 8/9/18 2:44 AM, Walter Bright wrote: So it turns out that technically the problem here, even though it seemed like an autodecoding problem, is a problem with splitter. splitter doesn't deal with encodings of cha

Re: More fun with autodecoding

2018-09-10 Thread Jonathan M Davis via Digitalmars-d
On Saturday, September 8, 2018 9:36:25 AM MDT Steven Schveighoffer via Digitalmars-d wrote: > On 8/9/18 2:44 AM, Walter Bright wrote: > > On 8/8/2018 2:01 PM, Steven Schveighoffer wrote: > >> Here's where I'm struggling -- because a string provides indexing, > >> slicing, length, etc. but Phobos i

Re: More fun with autodecoding

2018-09-09 Thread Jon Degenhardt via Digitalmars-d
On Saturday, 8 September 2018 at 15:36:25 UTC, Steven Schveighoffer wrote: On 8/9/18 2:44 AM, Walter Bright wrote: On 8/8/2018 2:01 PM, Steven Schveighoffer wrote: Here's where I'm struggling -- because a string provides indexing, slicing, length, etc. but Phobos ignores that. I can't make a n

Re: More fun with autodecoding

2018-09-09 Thread Steven Schveighoffer via Digitalmars-d
On 8/9/18 2:44 AM, Walter Bright wrote: On 8/8/2018 2:01 PM, Steven Schveighoffer wrote: Here's where I'm struggling -- because a string provides indexing, slicing, length, etc. but Phobos ignores that. I can't make a new type that does the same thing. Not only that, but I'm finding the specia

Re: More fun with autodecoding

2018-09-09 Thread Steven Schveighoffer via Digitalmars-d
On 9/8/18 8:36 AM, Steven Schveighoffer wrote: Sent this when I was on a plane, and for some reason it posted with the timestamp when I hit "send later", not when I connected just now. So this is to bring the previous message back to the forefront. -Steve

Re: More fun with autodecoding

2018-08-09 Thread Jon Degenhardt via Digitalmars-d
On Wednesday, 8 August 2018 at 21:01:18 UTC, Steven Schveighoffer wrote: Not trying to give too much away about the library I'm writing, but the problem I'm trying to solve is parsing out tokens from a buffer. I want to delineate the whole, as well as the parts, but it's difficult to get back t

Re: More fun with autodecoding

2018-08-08 Thread Walter Bright via Digitalmars-d
On 8/8/2018 2:01 PM, Steven Schveighoffer wrote: Here's where I'm struggling -- because a string provides indexing, slicing, length, etc. but Phobos ignores that. I can't make a new type that does the same thing. Not only that, but I'm finding the specializations of algorithms only work on the

Re: More fun with autodecoding

2018-08-08 Thread Steven Schveighoffer via Digitalmars-d
On 8/8/18 4:13 PM, Walter Bright wrote: On 8/6/2018 6:57 AM, Steven Schveighoffer wrote: But I'm not sure if the performance is going to be the same, since now it will likely FORCE autodecoding on the algorithms that have specialized versions to AVOID autodecoding (I think). Autodecoding is e

Re: More fun with autodecoding

2018-08-08 Thread Walter Bright via Digitalmars-d
On 8/6/2018 6:57 AM, Steven Schveighoffer wrote: But I'm not sure if the performance is going to be the same, since now it will likely FORCE autodecoding on the algorithms that have specialized versions to AVOID autodecoding (I think). Autodecoding is expensive which is why the algorithms defe

Re: More fun with autodecoding

2018-08-08 Thread bauss via Digitalmars-d
On Monday, 6 August 2018 at 13:57:10 UTC, Steven Schveighoffer wrote: I'm very tempted to start writing my own parsing utilities and avoid using Phobos algorithms... -Steve Oh yes; the good old autodecoding.