On 16.03.2014 15:24, Manu wrote:
On 16 March 2014 21:28, Rainer Schuetze <[email protected]
<mailto:[email protected]>> wrote:


    alias export extern(Windows) void function() fnWINAPI;

    @functionAttributesOf!fnWINAPI HANDLE GetCurrentProcess();


I frequently find myself needing something like this. What's wrong with
aliasing attributes directly?
DGC/LDC offer their own internal attributes, but you can't make use of
them and remain portable without an ability to do something like the
#define hack in C.

Unfortunately, it doesn't fit very well with the grammar to allow something like

alias @property const final nothrow @safe pure propertyGet;

(or some special syntax) and then parse

propertyGet UserType fun();

because it's ambiguous whithout semantic knowlegde of the identifiers. It becomes unambiguous with UDA syntax, though:

@propertyGet UserType fun();

I suspect propertyGet would have to describe some new "entity" that needs to be able to be passed around, aliased, used in CTFE, etc.

Reply via email to