New std.range submodule

monarch_dodra via Digitalmars-d digitalmars-d at puremagic.com
Fri Nov 21 05:08:39 PST 2014


On Wednesday, 19 November 2014 at 18:22:27 UTC, H. S. Teoh via
Digitalmars-d wrote:
> On Wed, Nov 19, 2014 at 06:06:26PM +0000, Nick Treleaven via 
> Digitalmars-d wrote:
>> On 14/11/2014 21:52, David Nadlinger wrote:
>> >On Friday, 14 November 2014 at 06:10:43 UTC, Rikki Cattermole 
>> >wrote:
>> >>std.range.checks
>> >
>> >For this, std.range.constraints would also be perfectly fine.
>> 
>> If it's not too late, can we change the name to 
>> std.range.traits? It
>> seems better as they can be used in 'static if', not just for 
>> template
>> constraints. Plus it's shorter and consistent with std.traits 
>> naming.
>
> It's not too late until the next release.
>
> I prefer std.range.primitives, since it's not just traits, but 
> also
> includes things like range API for built-in arrays (.front, 
> .empty,
> .popFront).
>
>
> T

I think "constraints" should be called "traits", because that's
what it actually is, and the top level module is called "traits"
(eg: isSomeString <==> isForwardRange). It makes little sense to 
me for both to have different names.

The "popFront"/"moveFront" and friends I think belong in
"primitives". It sounds nice.

Also, every package std.range.* should publicly include
std.range.constraints too. That's what container does, in that
every sub package also includes the the "make" in
std.container.utility.


More information about the Digitalmars-d mailing list