DMD supports ranges, but druntime can't see them?

Jonathan M Davis newsgroup.d at jmdavisprog.com
Thu May 23 15:50:06 UTC 2019


On Thursday, May 23, 2019 1:45:23 AM MDT Seb via Digitalmars-d wrote:
> On Thursday, 23 May 2019 at 07:40:20 UTC, Mike Franklin wrote:
> > On Thursday, 23 May 2019 at 07:26:34 UTC, Mike Franklin wrote:
> >> On Thursday, 23 May 2019 at 07:17:19 UTC, Manu wrote:
> >>> So, std.range.primitives -> core.range ?
> >>
> >> Take your best guess, submit a PR and see what the reviewers
> >> say.
> >>
> >>  If I had to make a decision, I'd just mimic what's in Phobos
> >>
> >> (i.e. replace `std` with `core`), unless there's a good reason
> >> not to.
> >
> > A more conservative approach would be to put them in
> > `core.internal`.  `core.internal.traits` is already there.  My
> > understanding is that anything in `core.internal` is not
> > intended for public consumption, so we could start there
> > without committing to a public interface that we'd have to
> > maintain.  It can always be exposed publicly later when the
> > future becomes more clear.
> >
> > Mike
>
> Yes, let's go with core.internal.range.
>
> Motivation: when we can the package name, we have the unique
> opportunity of getting rid of some historic range missteps like
> auto-decoding for strings or using a special save() constructor
> for ForwardRanges to support class ranges.

Anything along those lines that gets done in druntime at this point needs to
not be part of the public API, because if we're really going to do some kind
of phobos v2 and fix some of the mistakes with ranges, we want to get it
right. And if we have something in core which is public, that will get in
the way of that. Either way, it won't work to copy what we have in
std.range.primitives right now (at least not for strings), because that
relies on std.utf. However, since actually redesigning ranges is a much
larger discussion, it really wouldn't be appropriate to just throw a new API
in druntime either. So, I don't know that it's appropriate to put much in
the way of range stuff in druntime at the moment. Not much there should even
need it either. Regardless, anything that is done needs to be completely
internal for now.

- Jonathan M Davis





More information about the Digitalmars-d mailing list