User Defined Attributes
David Nadlinger
see at klickverbot.at
Tue Nov 6 09:44:14 PST 2012
On Tuesday, 6 November 2012 at 17:32:55 UTC, David Nadlinger
wrote:
> Currently, the equivalent D code for the interface would look
> something like this:
>
> ---
> interface Calculator : SharedService {
> int calculate(int a, int b, Op op);
>
> enum methodMeta = [
> TMethodMeta(`calculate`,
> [TParamMeta(`a`, 1), TParamMeta(`b`, 2), TParamMeta(`op`,
> 3)]
> )
> ];
> }
> ---
(Note that this is actual code that has the intended result with
DMD 2.060. Now with UDAs in the picture, one could obviously make
TMethodMeta a method-level annotation.)
David
More information about the Digitalmars-d-announce
mailing list