Source code annotations alla Java

Andrew Wiley debio264 at
Thu Jan 20 06:12:05 PST 2011

On Thu, Jan 20, 2011 at 8:02 AM, Steven Schveighoffer
<schveiguy at>wrote:

> On Thu, 20 Jan 2011 08:47:28 -0500, Justin Johansson <jj at>
> wrote:
>  Not long ago the Java Language people introduced the idea of annotations
>> together with an annotation processing tool (apt).
>> Now perhaps the idea of source code annotations is not actually a Java
>> invention per se, however for someone learning D is there any equivalent
>> idiom [of Java annotations] in the D language?
> Haven't used Java since they added annotations, but I think they are like
> C# attributes?
> In any case, D has an annotation syntax like:
> @property
> But I think at the moment, annotations have no custom ability.  Only
> compiler-defined annotations are allowed.  This may change in the future,
> but probably not short-term.  FWIW, I think we need a much richer
> runtime-reflection capability before we can use custom annotations to any
> great effect.

I would find it useful to be able to access annotations as part of compile
time reflection, actually, but AFAIK no progress has been made on that front
so far.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Digitalmars-d-learn mailing list