<div class="gmail_extra"><div class="gmail_quote">On 18 December 2012 15:29, Adam D. Ruppe <span dir="ltr"><<a href="mailto:destructionator@gmail.com" target="_blank">destructionator@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im">On Tuesday, 18 December 2012 at 15:19:58 UTC, Iain Buclaw wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Should we take this as an opportunity for other compiler maintainers to implement their own compiler-specific predefined attributes?<br>
</blockquote>
<br></div>
I think it'd be great if we used magical full names, but otherwise it is the same as the library. Then they are namespaced and can be shared.<br>
<br>
module core.gdc;<br>
struct noreturn {}<br>
// and whatever<br>
<br>
<br>
Then when you use it, you import core.gdc and use @noreturn. The compiler doesn't define the attribute, but it recognizes the full name of core.gdc.noreturn and gives it special treatment like an intrinsic.<br>
</blockquote></div><br>If doing it that way, it would be better to store all predefined attributes into a binary tree.<br><br>UserAttributeDeclaration::addPredefinedAttribute("property");  // etc<br><br><br>And have a magical empty module, gcc.attributes, which when imported injects the compiler-specific attributes.<br>
<br>UserAttributeDeclaration::addPredefinedAttribute("noreturn");  // etc<br><br><br>-- <br>Iain Buclaw<br><br>*(p < e ? p++ : p) = (c & 0x0f) + '0';<br>
</div>