<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 18 December 2012 20:11, Johannes Pfau <span dir="ltr"><<a href="mailto:nospam@example.com" target="_blank">nospam@example.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am Tue, 18 Dec 2012 20:06:16 +0100<br>
schrieb "jerro" <<a href="mailto:a@a.com">a@a.com</a>>:<br>
<div class="im"><br>
> You could also define them in compiler<br>
> specific modules as has already been discussed in this thread,<br>
> but then code that used them without full names (including the<br>
> module name) would break if an attribute with the same name was<br>
> added to the language.<br>
<br>
</div>We could do this: Language attributes (@property, @safe, ...) are<br>
defined in "lang.attributes" (or choose some other name). Then add a<br>
public import of lang.attributes to object.di.<br>
<br>
GDC attributes are defined in gdc.attributes (or any other name). We<br>
could add an public import to object.di for gdc. Or we don't, that's a<br>
different discussion.<br>
<br>
The result is that you can always resolve conflicting attributes:<br>
If gdc introduces @noreturn in gdc.attributes you can now do this:<br>
------------------------<br>
//(Optional if gdc.attributes is imported in<br>
//object.di)<br>
import gdc.attributes;<br>
<br>
@noreturn void foo{}<br>
------------------------<br>
<br>
If a @noreturn attribute is now added to lang.attributes, the compiler<br>
will refuse to compile the above code as it's ambiguous. But you can<br>
now do this:<br>
<br>
@lang.attributes.noreturn void foo{}<br>
or<br>
@gdc.attributes.noreturn void foo{}<br>
<br>
or<br>
import gdc = gdc.attributes;<br>
@gdc.noreturn void foo{}<br>
</blockquote></div><br><br></div><div class="gmail_extra">Someone recently mentioned @gccAttribute("foo", "bar");  as a prototype.<br><br clear="all"></div><div class="gmail_extra"><br>-- <br>Iain Buclaw<br>
<br>*(p < e ? p++ : p) = (c & 0x0f) + '0';
</div></div>