User Defined Attributes

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Nov 14 14:39:05 PST 2012


On 11/14/12 1:13 PM, Walter Bright wrote:
> On 11/14/2012 2:53 AM, Jacob Carlborg wrote:
>> If "std.mytypes.mystring" is a variable of the type "string" then the
>> fully
>> qualified name is lost if it's used as an attribute. Something like this:
>
> I am having a REALLY hard time making my point here.
>
> struct MyString
> {
> string s;
> }
>
> Now use MyString as an attribute. No, the name is not lost. Yes, two
> different modules can use MyString as an attribute, and impute
> completely different meanings into it.
>
> Just because it is not a builtin type does not change anything.

I think a simple way to put this is that attribute name lookup works the 
same as ordinary symbol lookup. Assuming we did a good job at the 
latter, the former doesn't introduce any specific issues.

Andrei


More information about the Digitalmars-d-announce mailing list