jared771 at gmail.com
Fri Oct 18 16:14:26 UTC 2019
On Friday, 18 October 2019 at 15:56:24 UTC, jmh530 wrote:
> On Friday, 18 October 2019 at 15:12:45 UTC, Meta wrote:
>> Not necessarily. I haven't tried this myself, but I think you
>> could get pretty far with UDAs and some template magic. What
>> I'm thinking:
> I don't understand this line:
> @given!(implements!(R, ForwardRange),
> implements!(inheritImpl!(ForwardRange, MapResult, R),
I wrote that in response to Rikki's assertion:
"This unfortunately still ties the implementation itself to the
interface. Which goes against DbI."
Just some spitballing on how DbI could harmoniously co-exist with
Atila's concepts library.
> I guess I still don't understand why you prefer the implements
> with interfaces rather than the concepts library's versions of
> isInputRange/isForwardRange/etc. What does this version add to
> the static if version (assuming phobos's isInputRange, etc.,
> were replaced with the concepts version?
I don't necessarily, but it's good to have options. I think it
would be very nice if the concepts library were as easy as
`import std.range.interfaces; @implements(InputRange,
MyCoolRangeType)`, because then the friction for using it is
reduced down to almost 0. I also just like the cleanliness of
separating the interface from the implementation, which
isInputRange also allows, but not in as clean a manner.
More information about the Digitalmars-d