syntax sugar: std.path::buildPath instead of from!"std.path".buildPath

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Thu Feb 16 05:21:04 PST 2017


On 2/16/17 7:11 AM, Atila Neves wrote:
> On Wednesday, 15 February 2017 at 17:10:26 UTC, Adam D. Ruppe wrote:
>> On Wednesday, 15 February 2017 at 07:56:00 UTC, Jacob Carlborg wrote:
>>> Your documentation is an improvement but it doesn't help when reading
>>> the source code.
>>
>> Yeah, I think there's a few things we can do in the source too. We
>> should find the common combinations and abstract them out, like I said
>> before, isInputRangeOf is potentially useful.
>>
>> Though, like Andrei, I'm skeptical on doing too much of that, since
>> the combinations can quickly explode and then you just have to search
>> through more to figure out wtf they mean.
>>
>> That'd help the source and docs if we find the right balance.
>
> I submitted a Phobos PR for `isInputRangeOf`. It was nuked from orbit. I
> understand why: as you mention, the combinatorial explosion of names is
> an issue. But: it's a mess rangeifying code when this:
>
> void fun(Foo[] foos);  // yay! readable
>
> becomes:
>
> void fun(R)(R foos) if(isInputRange!R && is(Unqual!(ElementType!R) == Foo);

If you find a number of these, that would be good evidence. -- Andrei



More information about the Digitalmars-d mailing list