Final by default?
Rainer Schuetze
r.sagitario at gmx.de
Sun Mar 16 08:58:32 PDT 2014
On 16.03.2014 15:24, Manu wrote:
> On 16 March 2014 21:28, Rainer Schuetze <r.sagitario at gmx.de
> <mailto:r.sagitario at gmx.de>> 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.
More information about the Digitalmars-d
mailing list