www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Source code annotations alla Java

reply Justin Johansson <jj nospam.com> writes:
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?
Jan 20 2011
next sibling parent Justin Johansson <jj nospam.com> writes:
On 21/01/11 00:47, Justin Johansson 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?

Fair to add that while finding the Java Language annotation concept interesting I am not entirely sure as to its usefulness. Thanks for answers, Justin Johansson
Jan 20 2011
prev sibling next sibling parent reply "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Thu, 20 Jan 2011 08:47:28 -0500, Justin Johansson <jj nospam.com> 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. -Steve
Jan 20 2011
next sibling parent reply Justin Johansson <jj nospam.com> writes:
On 21/01/11 01:02, Steven Schveighoffer wrote:
 On Thu, 20 Jan 2011 08:47:28 -0500, Justin Johansson <jj nospam.com> 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. -Steve

Thanks for answer. I wasn't expecting many enlightening responses. Yours was a pleasant reply, albeit a reflection of the current state of D. - Justin
Jan 20 2011
parent Jesse Phillips <jessekphillips+D gmail.com> writes:
Justin Johansson Wrote:

 Thanks for answer.  I wasn't expecting many enlightening responses. 
 Yours was a pleasant reply, albeit a reflection of the current state of D.
 
 - Justin

I think it is worth mentioning that the current syntax comes from DIP 6 http://www.prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP6 As whether custom annotations will happen, I haven't heard an official word. But it was somewhat an implied intent.
Jan 20 2011
prev sibling next sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2011-01-20 15:02, Steven Schveighoffer wrote:
 On Thu, 20 Jan 2011 08:47:28 -0500, Justin Johansson <jj nospam.com> 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. -Steve

I would rather formulate it like: currently D has a syntax for keywords that are similar to Java annotations. -- /Jacob Carlborg
Jan 20 2011
parent reply Jacob Carlborg <doob me.com> writes:
On 2011-01-20 19:18, Steven Schveighoffer wrote:
 On Thu, 20 Jan 2011 13:07:58 -0500, Jacob Carlborg <doob me.com> wrote:

 On 2011-01-20 15:02, Steven Schveighoffer wrote:
 On Thu, 20 Jan 2011 08:47:28 -0500, Justin Johansson <jj nospam.com>
 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. -Steve

I would rather formulate it like: currently D has a syntax for keywords that are similar to Java annotations.

I don't think it's the same thing. Keywords are not allowed to be used anywhere else, even for things that would parse properly were they not keywords. They are anchors for the parser to determine where it is. In contrast, a compiler-defined annotation is parsed just the same as a custom one, it's just that the meaning is predefined. For example, you can legally do: int property; without error, but this won't even get past the parsing stage: int struct; -Steve

I assume you meant "int property;"? -- /Jacob Carlborg
Jan 20 2011
parent reply Jacob Carlborg <doob me.com> writes:
On 2011-01-20 21:34, Steven Schveighoffer wrote:
 On Thu, 20 Jan 2011 15:03:55 -0500, Jacob Carlborg <doob me.com> wrote:

 On 2011-01-20 19:18, Steven Schveighoffer wrote:
 On Thu, 20 Jan 2011 13:07:58 -0500, Jacob Carlborg <doob me.com> wrote:

 On 2011-01-20 15:02, Steven Schveighoffer wrote:
 On Thu, 20 Jan 2011 08:47:28 -0500, Justin Johansson <jj nospam.com>
 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. -Steve

I would rather formulate it like: currently D has a syntax for keywords that are similar to Java annotations.

I don't think it's the same thing. Keywords are not allowed to be used anywhere else, even for things that would parse properly were they not keywords. They are anchors for the parser to determine where it is. In contrast, a compiler-defined annotation is parsed just the same as a custom one, it's just that the meaning is predefined. For example, you can legally do: int property; without error, but this won't even get past the parsing stage: int struct; -Steve

I assume you meant "int property;"?

No. I meant int property;

Of course that would work, isn't that like saying this won't work: int struct_; // ?
 A keyword is specifically not allowed where the grammar would otherwise
 allow it. A symbol isn't allowed to have   in it, so this naturally
 prevents a conflict. I realize the poor example, but it's definitely not
 a keyword. Otherwise, it would be listed here:
 http://www.digitalmars.com/d/2.0/lex.html#keyword (actually, are
 annotations part of the lexical grammar there?).

 It's more like Object, which is not a keyword, but you aren't allowed to
 use it to mean anything besides what it means.

 The end result is, it fails if you use it in the wrong place, but the
 keyword status makes it fail at the parsing stage. I am not a compiler
 writer, so I'm talking a bit from my ass here.

 -Steve

Ok, maybe you're right. I'm pretty sure, as you say, that a keyword in the wrong place would fail during parsing. But I don't know where a misplaced annotation/attribute would fail. -- /Jacob Carlborg
Jan 20 2011
next sibling parent Ary Manzana <ary esperanto.org.ar> writes:
On 1/20/11 5:48 PM, Jacob Carlborg wrote:
 On 2011-01-20 21:34, Steven Schveighoffer wrote:
 On Thu, 20 Jan 2011 15:03:55 -0500, Jacob Carlborg <doob me.com> wrote:

 On 2011-01-20 19:18, Steven Schveighoffer wrote:
 On Thu, 20 Jan 2011 13:07:58 -0500, Jacob Carlborg <doob me.com> wrote:

 On 2011-01-20 15:02, Steven Schveighoffer wrote:
 On Thu, 20 Jan 2011 08:47:28 -0500, Justin Johansson <jj nospam.com>
 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. -Steve

I would rather formulate it like: currently D has a syntax for keywords that are similar to Java annotations.

I don't think it's the same thing. Keywords are not allowed to be used anywhere else, even for things that would parse properly were they not keywords. They are anchors for the parser to determine where it is. In contrast, a compiler-defined annotation is parsed just the same as a custom one, it's just that the meaning is predefined. For example, you can legally do: int property; without error, but this won't even get past the parsing stage: int struct; -Steve

I assume you meant "int property;"?

No. I meant int property;

Of course that would work, isn't that like saying this won't work: int struct_; // ?
 A keyword is specifically not allowed where the grammar would otherwise
 allow it. A symbol isn't allowed to have   in it, so this naturally
 prevents a conflict. I realize the poor example, but it's definitely not
 a keyword. Otherwise, it would be listed here:
 http://www.digitalmars.com/d/2.0/lex.html#keyword (actually, are
 annotations part of the lexical grammar there?).

 It's more like Object, which is not a keyword, but you aren't allowed to
 use it to mean anything besides what it means.

 The end result is, it fails if you use it in the wrong place, but the
 keyword status makes it fail at the parsing stage. I am not a compiler
 writer, so I'm talking a bit from my ass here.

 -Steve

Ok, maybe you're right. I'm pretty sure, as you say, that a keyword in the wrong place would fail during parsing. But I don't know where a misplaced annotation/attribute would fail.

Jacob is right here. This, as you say, fails: int struct; And also this fails: int property; So yes, currently property is just a keyword with a prepended . Annotations in Java anc C# can have arguments. That is not the case in D. For example, as it is said in DIP6, you could have: extern('C') void someFunc(); instead of having extern a keyword and thus being unable to use it for identifiers.
Jan 21 2011
prev sibling parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Friday, January 21, 2011 12:36:23 Ary Manzana wrote:
 On 1/20/11 5:48 PM, Jacob Carlborg wrote:
 On 2011-01-20 21:34, Steven Schveighoffer wrote:
 On Thu, 20 Jan 2011 15:03:55 -0500, Jacob Carlborg <doob me.com> wrote:
 On 2011-01-20 19:18, Steven Schveighoffer wrote:
 On Thu, 20 Jan 2011 13:07:58 -0500, Jacob Carlborg <doob me.com> wrote:
 On 2011-01-20 15:02, Steven Schveighoffer wrote:
 On Thu, 20 Jan 2011 08:47:28 -0500, Justin Johansson <jj nospam.com>
 
 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. -Steve

I would rather formulate it like: currently D has a syntax for keywords that are similar to Java annotations.

I don't think it's the same thing. Keywords are not allowed to be used anywhere else, even for things that would parse properly were they not keywords. They are anchors for the parser to determine where it is. In contrast, a compiler-defined annotation is parsed just the same as a custom one, it's just that the meaning is predefined. For example, you can legally do: int property; without error, but this won't even get past the parsing stage: int struct; -Steve

I assume you meant "int property;"?

No. I meant int property;

Of course that would work, isn't that like saying this won't work: int struct_; // ?
 A keyword is specifically not allowed where the grammar would otherwise
 allow it. A symbol isn't allowed to have   in it, so this naturally
 prevents a conflict. I realize the poor example, but it's definitely not
 a keyword. Otherwise, it would be listed here:
 http://www.digitalmars.com/d/2.0/lex.html#keyword (actually, are
 annotations part of the lexical grammar there?).
 
 It's more like Object, which is not a keyword, but you aren't allowed to
 use it to mean anything besides what it means.
 
 The end result is, it fails if you use it in the wrong place, but the
 keyword status makes it fail at the parsing stage. I am not a compiler
 writer, so I'm talking a bit from my ass here.
 
 -Steve

Ok, maybe you're right. I'm pretty sure, as you say, that a keyword in the wrong place would fail during parsing. But I don't know where a misplaced annotation/attribute would fail.

Jacob is right here. This, as you say, fails: int struct; And also this fails: int property; So yes, currently property is just a keyword with a prepended . Annotations in Java anc C# can have arguments. That is not the case in D. For example, as it is said in DIP6, you could have: extern('C') void someFunc(); instead of having extern a keyword and thus being unable to use it for identifiers.

No. No attributes are keywords. The reasoning is simple. A keyword is a word that would be a valid identifier but isn't, because the language treats it as special. is not a valid part of an identifier. So, property can't be a keyword. And property certainly isn't a keyword, since you _can_ use it as an identifier, so it isn't a keyword with prepended on either. True, property is treated as a special symbol by the compiler, and I don't expect that it really treats it like an attribute with the name property (which it will pretty much have to do if we ever get user-defined attributes), but definitely isn't a keyword, because it was never possible for it to be a valid identifier in the first place. - Jonathan M Davis
Jan 21 2011
prev sibling next sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Thu, 20 Jan 2011 13:07:58 -0500, Jacob Carlborg <doob me.com> wrote:

 On 2011-01-20 15:02, Steven Schveighoffer wrote:
 On Thu, 20 Jan 2011 08:47:28 -0500, Justin Johansson <jj nospam.com>  
 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. -Steve

I would rather formulate it like: currently D has a syntax for keywords that are similar to Java annotations.

I don't think it's the same thing. Keywords are not allowed to be used anywhere else, even for things that would parse properly were they not keywords. They are anchors for the parser to determine where it is. In contrast, a compiler-defined annotation is parsed just the same as a custom one, it's just that the meaning is predefined. For example, you can legally do: int property; without error, but this won't even get past the parsing stage: int struct; -Steve
Jan 20 2011
prev sibling parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Thu, 20 Jan 2011 15:03:55 -0500, Jacob Carlborg <doob me.com> wrote:

 On 2011-01-20 19:18, Steven Schveighoffer wrote:
 On Thu, 20 Jan 2011 13:07:58 -0500, Jacob Carlborg <doob me.com> wrote:

 On 2011-01-20 15:02, Steven Schveighoffer wrote:
 On Thu, 20 Jan 2011 08:47:28 -0500, Justin Johansson <jj nospam.com>
 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. -Steve

I would rather formulate it like: currently D has a syntax for keywords that are similar to Java annotations.

I don't think it's the same thing. Keywords are not allowed to be used anywhere else, even for things that would parse properly were they not keywords. They are anchors for the parser to determine where it is. In contrast, a compiler-defined annotation is parsed just the same as a custom one, it's just that the meaning is predefined. For example, you can legally do: int property; without error, but this won't even get past the parsing stage: int struct; -Steve

I assume you meant "int property;"?

No. I meant int property; A keyword is specifically not allowed where the grammar would otherwise allow it. A symbol isn't allowed to have in it, so this naturally prevents a conflict. I realize the poor example, but it's definitely not a keyword. Otherwise, it would be listed here: http://www.digitalmars.com/d/2.0/lex.html#keyword (actually, are annotations part of the lexical grammar there?). It's more like Object, which is not a keyword, but you aren't allowed to use it to mean anything besides what it means. The end result is, it fails if you use it in the wrong place, but the keyword status makes it fail at the parsing stage. I am not a compiler writer, so I'm talking a bit from my ass here. -Steve
Jan 20 2011
prev sibling next sibling parent Andrew Wiley <debio264 gmail.com> writes:
--20cf3054a66be8160c049a47b7c4
Content-Type: text/plain; charset=ISO-8859-1

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

 On Thu, 20 Jan 2011 08:47:28 -0500, Justin Johansson <jj nospam.com>
 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. --20cf3054a66be8160c049a47b7c4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <br><br><div class=3D"gmail_quote">On Thu, Jan 20, 2011 at 8:02 AM, Steven = Schveighoffer <span dir=3D"ltr">&lt;<a href=3D"mailto:schveiguy yahoo.com">= schveiguy yahoo.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quo= te" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;= "> <div class=3D"im">On Thu, 20 Jan 2011 08:47:28 -0500, Justin Johansson &lt;= <a href=3D"mailto:jj nospam.com" target=3D"_blank">jj nospam.com</a>&gt; wr= ote:<br> <br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> Not long ago the Java Language people introduced the idea of annotations to= gether with an annotation processing tool (apt).<br> <br> Now perhaps the idea of source code annotations is not actually a Java inve= ntion per se, however for someone learning D is there any equivalent idiom = [of Java annotations] in the D language?<br> </blockquote> <br></div> Haven&#39;t used Java since they added annotations, but I think they are li= ke C# attributes?<br> <br> In any case, D has an annotation syntax like:<br> <br> property<br> <br> But I think at the moment, annotations have no custom ability. =A0Only comp= iler-defined annotations are allowed. =A0This may change in the future, but= probably not short-term. =A0FWIW, I think we need a much richer runtime-re= flection capability before we can use custom annotations to any great effec= t.<br> </blockquote><div><br></div><div>I would find it useful to be able to acces= s annotations as part of compile time reflection, actually, but AFAIK no pr= ogress has been made on that front so far.=A0</div></div><br> --20cf3054a66be8160c049a47b7c4--
Jan 20 2011
prev sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2011-01-20 14:47, Justin Johansson 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?

Depending on what you want to do you can create a template mixin that accepts string(s)/alias(es). For example: for the serialization library (http://dsource.org/projects/orange) I'm working on the following syntax is used: class Foo { int x; int y; int z; mixin NonSerialized!(z); } The above mixin indicates that the "z" instance variable shouldn't be serialized. This is (currently) achieved by defining a field in the mixed in template (which will be added to the class) which is a struct containing the string of the filed which shouldn't be serialized. Then I iterate over all the fields in the class with .tupleof and collects all mixed in fields in a list. Then I know what fields to skip later during the serialization. -- /Jacob Carlborg
Jan 20 2011
next sibling parent reply Trass3r <un known.com> writes:
 class Foo
 {
      int x;
      int y;
      int z;

      mixin NonSerialized!(z);
 }

Had a quick look at http://dsource.org/projects/orange/browser/orange/serialization/Serializable.d 1. How come it works without 'mixin' in the template declaration (mixin template NonSerialized)? 2. What if several fields need to be tagged? 3. Is there a reason to use a struct instead of e.g. __nonSerialized = ["field1", "field2", ...]? 4. Couldn't that field be static to save space or maybe even enum?
Jan 20 2011
parent Jacob Carlborg <doob me.com> writes:
On 2011-01-20 20:10, Trass3r wrote:
 class Foo
 {
 int x;
 int y;
 int z;

 mixin NonSerialized!(z);
 }

Had a quick look at http://dsource.org/projects/orange/browser/orange/serialization/Serializable.d 1. How come it works without 'mixin' in the template declaration (mixin template NonSerialized)?

I think it's optional, it works with DMD 2.052
 2. What if several fields need to be tagged?

You use the mixin several times.
 3. Is there a reason to use a struct instead of e.g. __nonSerialized =
 ["field1", "field2", ...]?

Hmm, I think I had a good reason. First it needs to be const so it works during compile time. But I think I used a struct because I used that on another project which required more data than just then name the field. If I would store it in an array you could only do the mixin once, I think. And that would require you to use strings instead of aliases, I think. template foo (args...) {} Does that work with aliases?
 4. Couldn't that field be static to save space or maybe even enum?

That field should absolutely be static, I'm currently working on fixing that. I didn't think of that when I implemented it. This will also only work with one mixin (see the answer for the third comment). -- /Jacob Carlborg
Jan 20 2011
prev sibling next sibling parent "Simen kjaeraas" <simen.kjaras gmail.com> writes:
Trass3r <un known.com> wrote:

 class Foo
 {
      int x;
      int y;
      int z;

      mixin NonSerialized!(z);
 }

Had a quick look at http://dsource.org/projects/orange/browser/orange/serialization/Serializable.d 1. How come it works without 'mixin' in the template declaration (mixin template NonSerialized)?

Templates are not currently required to be marked as mixin templates in order to be used as such. However, a mixin template can only be instantiated as a mixin. -- Simen
Jan 20 2011
prev sibling parent Trass3r <un known.com> writes:
 template foo (args...) {}

 Does that work with aliases?

Well at least the following compiles: template Foo(T...,) { int i; } int a,b; alias Foo!(a,b) f;
Jan 20 2011