User Defined Attributes (UDA) in Phobos/druntime

Steven Schveighoffer schveiguy at yahoo.com
Tue Jun 11 08:22:19 PDT 2013


On Tue, 11 Jun 2013 05:58:50 -0400, Jacob Carlborg <doob at me.com> wrote:

> On 2013-06-11 11:07, Jonas Drewsen wrote:
>
>> Jacob: Would it be doable to refactor the attribute magic in
>> std.serialization into a separate module that could be provided as 3rd
>> party extension to std.serialization until phobos itself is ready for
>> attributes?
>
> The generic code for attributes is located in orange.core.Attribute,  
> this can be inlined or removed. The actual attributes them self are  
> located in orange.serialization.Serializable.
>
> The library is perfectly usable without UDA's. The old template mixins  
> are still available.
>
> If __traits(getAttributes) is not allowed in Phobos then I have to  
> remove the code that checks for UDA's.
>

I think we can have and use UDAs in Phobos without yet having to create a  
guideline.  Note that there is lots of experience with attributes in other  
languages that we can draw from.  Most people here have written in at  
least one other language that uses them.

I have no problem with std.serialization using attributes, even if there  
is no "official" guide.

-Steve


More information about the Digitalmars-d mailing list