www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Simple tagged attribute for unions [OT]

reply Andrew Wiley <debio264 gmail.com> writes:
--001636c59a2ea75ab9049570da84
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Nov 19, 2010 at 5:46 PM, Bruno Medeiros
<brunodomedeiros+spam com.gmail> wrote:

 On 22/10/2010 04:04, Andrei Alexandrescu wrote:

 On 10/21/2010 08:41 PM, bearophile wrote:

 I have suggested yet another attribute,  tagged:
 http://d.puremagic.com/issues/show_bug.cgi?id=5097

 Bye, bearophile

And almost exactly six hours ago: On the other hand, currently there are many D2 features that are
 unfinished and buggy, so adding even more stuff is not a good idea.
 And I think named arguments are a purely additive change. So Walter
 may add them later when the current features are implemented well
 enough. Currently it's much more important to focus on eventually
 needed non-additive changes instead.

Hope you agree with yourself :o). Andrei

How did I miss that! It's bearophile's best comment ever! :D

This isn't really related but it's an idea that I randomly had while reading that bug report: What if functionality like this could be implemented in mixins rather than compiler-defined annotations? The idea would be that an annotation, when applied to something, would be "instantiated" in some form, allowing it to mixin code somehow. I know that's vague, but it seems like it would have powerful applications for things like ORM libraries and other libraries. On the other hand, annotations go from metadata to something that potentially changes the code you're writing, which may not be a good idea. Disclaimer: This is utterly random and you're free to tell me it's foolishness. --001636c59a2ea75ab9049570da84 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div class=3D"gmail_quote">On Fri, Nov 19, 2010 at 5:46 PM, Bruno Medeiros = <span dir=3D"ltr">&lt;brunodomedeiros+spam com.gmail&gt;</span> wrote:<br><= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex;"> On 22/10/2010 04:04, Andrei Alexandrescu wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> On 10/21/2010 08:41 PM, bearophile wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> I have suggested yet another attribute, tagged:<br> <a href=3D"http://d.puremagic.com/issues/show_bug.cgi?id=3D5097" target=3D"= _blank">http://d.puremagic.com/issues/show_bug.cgi?id=3D5097</a><br> <br> Bye, bearophile<br> </blockquote> <br> And almost exactly six hours ago:<br> <br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> On the other hand, currently there are many D2 features that are<br> unfinished and buggy, so adding even more stuff is not a good idea.<br> And I think named arguments are a purely additive change. So Walter<br> may add them later when the current features are implemented well<br> enough. Currently it&#39;s much more important to focus on eventually<br> needed non-additive changes instead.<br> </blockquote> <br> Hope you agree with yourself :o).<br> <br> <br> Andrei<br> </blockquote> <br> How did I miss that! It&#39;s bearophile&#39;s best comment ever! :D</block= quote><div><br></div><div><br></div><div>This isn&#39;t really related but = it&#39;s an idea that I randomly had while reading that bug report:</div> <div>What if functionality like this could be implemented in mixins rather = than compiler-defined annotations? The idea would be that an annotation, wh= en applied to something, would be &quot;instantiated&quot; in some form, al= lowing it to mixin code somehow. I know that&#39;s vague, but it seems like= it would have powerful applications for things like ORM libraries and othe= r libraries.</div> <div>On the other hand, annotations go from metadata to something that pote= ntially changes the code you&#39;re writing, which may not be a good idea.<= /div><div><br></div><div>Disclaimer: This is utterly random and you&#39;re = free to tell me it&#39;s foolishness.=A0</div> </div><br> --001636c59a2ea75ab9049570da84--
Nov 19 2010
parent Bruno Medeiros <brunodomedeiros+spam com.gmail> writes:
On 20/11/2010 00:10, Andrew Wiley wrote:
 On Fri, Nov 19, 2010 at 5:46 PM, Bruno Medeiros
 <brunodomedeiros+spam com.gmail> wrote:

     On 22/10/2010 04:04, Andrei Alexandrescu wrote:

         On 10/21/2010 08:41 PM, bearophile wrote:

             I have suggested yet another attribute,  tagged:
             http://d.puremagic.com/issues/show_bug.cgi?id=5097

             Bye, bearophile


         And almost exactly six hours ago:

             On the other hand, currently there are many D2 features that are
             unfinished and buggy, so adding even more stuff is not a
             good idea.
             And I think named arguments are a purely additive change. So
             Walter
             may add them later when the current features are implemented
             well
             enough. Currently it's much more important to focus on
             eventually
             needed non-additive changes instead.


         Hope you agree with yourself :o).


         Andrei


     How did I miss that! It's bearophile's best comment ever! :D



 This isn't really related but it's an idea that I randomly had while
 reading that bug report:
 What if functionality like this could be implemented in mixins rather
 than compiler-defined annotations? The idea would be that an annotation,
 when applied to something, would be "instantiated" in some form,
 allowing it to mixin code somehow. I know that's vague, but it seems
 like it would have powerful applications for things like ORM libraries
 and other libraries.
 On the other hand, annotations go from metadata to something that
 potentially changes the code you're writing, which may not be a good idea.

 Disclaimer: This is utterly random and you're free to tell me it's
 foolishness.

That would effectively be a form of macros, using annotations instead of function-call-like syntax. In the earlier stages of D (D1) there were plans to add at some point some form of macros (AST macros), working kind like implicit mixins. But with all the D2 stuff it got pushed way back in the new features wishlist (informally speaking, to D3). The general interest for that feature might have waned. I personally was never too keen on that, in fact I was (and still am) a bit apprehensive about such a feature. -- Bruno Medeiros - Software Engineer
Dec 07 2010