Proposal to add 'Elements of Programming' Concepts to std.traits

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Jun 27 05:42:05 PDT 2012


On 6/22/12 5:37 PM, Guillaume Chatelet wrote:
> On 06/18/12 04:18, Andrei Alexandrescu wrote:
>> I think traits are something that we could add piecemeal, without a
>> large proposal - just as pull requests. For each particular concept
>> there should be 1-2 compelling examples in the documentation, enough to
>> make a case that the notion being added is worthwhile.
>>
>> For a simple example I'd like "arity" (I'm unclear whether it belongs in
>> std.traits or std.functional). Sure, I could write
>> ParameterTypeTuple!fun.length, but that's quite a roundabout way to go
>> about it.
>>
>>
>> Andrei
>
> So here it is. A first very small patch to add arity to std.traits.
>
> As you stated it could really go either in std.traits or std.functional.
> I chose to keep it in std.traits because std.functional is more about
> creating new functions of modifying existing ones whereas std.traits is
> about deducing properties.

Great. You should know I'm on vacation with scant access to email.

Andrei



More information about the Digitalmars-d mailing list