Re: User Defined Attributes

2012-11-08 Thread Andrei Alexandrescu
On 11/8/12 12:20 AM, Walter Bright wrote: One last thing. Sure, string attributes can (and surely would be) used for different purposes in different libraries. The presumption is that this would cause a conflict. But would it? There are two aspects to a UDA - the attribute itself, and the symbol

Re: User Defined Attributes

2012-11-08 Thread Max Samukha
On Thursday, 8 November 2012 at 09:08:23 UTC, Max Samukha wrote: alias getAttribute!(b, foo) t; Ignore that line.

Re: Mono-D v0.4.1.9

2012-11-08 Thread alex
On Wednesday, 7 November 2012 at 12:48:30 UTC, Bruno Medeiros wrote: On 24/08/2012 00:18, alex wrote: Hi everyone, Right after the GSoC finished (I'm really sure I passed :)), I've just found more time to improve things drastically: I also have to extend my congratulations for the work

Re: User Defined Attributes

2012-11-08 Thread Walter Bright
On 11/7/2012 11:27 PM, Jacob Carlborg wrote: On 2012-11-08 02:49, Walter Bright wrote: Yes, that makes the attribute global. I don't actually know how this works in Java but if you are forced to use the fully qualified name for the attribute it won't make the attribute global. A plugin

Re: User Defined Attributes

2012-11-08 Thread Jacob Carlborg
On 2012-11-08 11:56, Walter Bright wrote: A plugin would apply globally, wouldn't it? Yes, but that wouldn't make the attribute global. I just had a quick look on the Annotation Processing Tool (APT) available in Java. This tool will run an annotation processor over some specified Java

Re: User Defined Attributes

2012-11-08 Thread Jacob Carlborg
On 2012-11-08 10:08, Max Samukha wrote: Could you explain why it is impossible without complicating the current state of things? I gave it a quick try and it seems to work reasonably well (a proper implementation will be more involved due to compiler bugs and language issues irrelevant to this

Mono-D v0.4.1.9

2012-11-08 Thread alex
Between all these discussions about new D language features :) A new version just released. For any info, see http://mono-d.alexanderbothe.com Issues go here: https://github.com/aBothe/Mono-D/issues If you've downloaded MonoDevelop from download.monodevelop.com, please download the latest

Re: User Defined Attributes

2012-11-08 Thread Max Samukha
On Thursday, 8 November 2012 at 12:42:38 UTC, Jacob Carlborg wrote: On 2012-11-08 10:08, Max Samukha wrote: Could you explain why it is impossible without complicating the current state of things? I gave it a quick try and it seems to work reasonably well (a proper implementation will be more

Re: Mono-D v0.4.1.9

2012-11-08 Thread F i L
On Thursday, 8 November 2012 at 17:50:35 UTC, alex wrote: Between all these discussions about new D language features :) A new version just released. For any info, see http://mono-d.alexanderbothe.com Issues go here: https://github.com/aBothe/Mono-D/issues If you've downloaded MonoDevelop

Re: User Defined Attributes

2012-11-08 Thread Walter Bright
On 11/8/2012 4:37 AM, Jacob Carlborg wrote: On 2012-11-08 11:56, Walter Bright wrote: A plugin would apply globally, wouldn't it? Yes, but that wouldn't make the attribute global. I just had a quick look on the Annotation Processing Tool (APT) available in Java. This tool will run an

Re: User Defined Attributes

2012-11-08 Thread Jacob Carlborg
On 2012-11-08 20:39, Walter Bright wrote: I believe that does have the essential effect of making the attribute global. I don't understand how. -- /Jacob Carlborg

Re: User Defined Attributes

2012-11-08 Thread Tove
On Wednesday, 7 November 2012 at 08:41:48 UTC, Walter Bright wrote: New version up now with a couple reported problems with UDA fixed. I may have found a little glitch...? mixin([1] int a;); [[2] int b;] int c; mixin(__traits(getAttributes, c)[0]); pragma(msg, __traits(getAttributes, a)); =

Re: User Defined Attributes

2012-11-08 Thread Walter Bright
On 11/8/2012 12:00 PM, Jacob Carlborg wrote: On 2012-11-08 20:39, Walter Bright wrote: I believe that does have the essential effect of making the attribute global. I don't understand how. Because plugins are a global thing. If you have a plugin that deals with attribute 'X', then you

Re: User Defined Attributes

2012-11-08 Thread Jacob Carlborg
On 2012-11-08 23:31, Walter Bright wrote: Because plugins are a global thing. If you have a plugin that deals with attribute 'X', then you cannot have two plugins that interpret 'X' differently, i.e. 'X' becomes, for all practical purposes, global. Well, 'X' is supposed to be the fully

Re: User Defined Attributes

2012-11-08 Thread Jacob Carlborg
On 2012-11-08 19:03, Max Samukha wrote: The problem is where to draw the line. There is nothing to stop an idiot programmer from applying your attributes to a wrong target, so we'd better take care of that by introducing those target-restricting attributes specially treated by the compiler.