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

Daniel N via Digitalmars-d digitalmars-d at puremagic.com
Wed Feb 15 01:22:14 PST 2017


On Wednesday, 15 February 2017 at 08:59:49 UTC, Jacob Carlborg 
wrote:
> On 2017-02-15 09:19, Walter Bright wrote:
>> On 2/14/2017 9:28 PM, Adam D. Ruppe wrote:
>>> On Tuesday, 14 February 2017 at 20:46:17 UTC, Walter Bright 
>>> wrote:
>>>> A further improvement in the documentation would be to add 
>>>> links to
>>>> isBidirectionalRange and hasLvalueElements.
>>>
>>> Kneel before your god!
>>>
>>> http://dpldocs.info/experimental-docs/std.algorithm.mutation.remove.1.html
>>>
>>>
>>> Take a look at this insane automatic cross referencing:
>>>
>>> http://dpldocs.info/experimental-docs/std.range.chain.html
>>>
>>>
>>> My ref thing still isn't perfect, but dpldocs is already 
>>> streets ahead of
>>> anything dlang.org has to offer and continues to make bursts 
>>> of strides.
>>
>> That looks pretty sweet!
>
> Doesn't help when reading the source code :(.

Something akin to this would improve readability at least for me, 
also more DRY.

    isInputRange!(InputRange1)
&& isInputRange!(InputRange2)
&& hasSwappableElements!(InputRange1)
&& hasSwappableElements!(InputRange2)

   =>

every!(InputRange1, InputRange2).
satisfies!(isInputRange, hasSwappableElements);



template every(T...)
{
	template satisfies(U...)
	{
		enum satisfies = true;
	}
}



More information about the Digitalmars-d mailing list