Enhancement on `export` symbol

Johan j at j.nl
Fri Mar 14 12:07:00 UTC 2025


On Friday, 14 March 2025 at 02:46:08 UTC, Richard (Rikki) Andrew 
Cattermole wrote:
> https://github.com/dlang/DIPs/blob/master/DIPs/other/DIP1045.md#export-annotation

My intuition says that it'll be more broadly useful if attributes 
can be combined and aliased.
Something like this:

```
version(X) {
   // some arbitrary list of attributes
   alias attribs = AliasSeq!(export, extern(C), 
ldc.attributes.weak);
} else {
   // some arbitrary list of attributes
   alias attribs = AliasSeq!(extern(D), ldc.attributes.hidden);
}

@attribs
void foo() {}
```

You can already do this for the LDC attributes (because they are 
implemented as magic types), but not for D core language 
attributes.

-Johan


More information about the Digitalmars-d mailing list