I want to add a Phobos module with template mixins for common idioms.

Idan Arye GenericNPC at gmail.com
Tue May 7 13:46:43 PDT 2013


On Tuesday, 7 May 2013 at 19:10:23 UTC, Idan Arye wrote:
> Anyways, a small enhancement to dmd can help solve both 
> problems easily - a mixin template that has an identifier and 
> does not leak to the surrounding scope.

Actually, forget about that enhancement - I can use aliases, CTFE 
and a mixin to solve that problem.

On Tuesday, 7 May 2013 at 20:25:21 UTC, Dicebot wrote:
> On Tuesday, 7 May 2013 at 19:10:23 UTC, Idan Arye wrote:
>> So, we have to change it:
>>
>>    class Test
>>    {
>>        private:
>>            @Property int m_foo;
>>        public:
>>            mixin implementAnnotations!Test;
>>    }
>>
>> and inside `implementAnnotations` we would have to strip 
>> `m_foo` out of it's prefix to get the getter&setter names.
>
> I believe it is exactly how it should be. With changeable 
> compile-time naming convention function.

So this is where we disagree. I believe that if you want a 
property named `foo` you should be able to just name it `foo` to 
begin with.


More information about the Digitalmars-d mailing list