digitalmars.D - automatic mixin in classes
- Gor Gyolchanyan <gor.f.gyolchanyan gmail.com> Oct 26 2012
- "Chris Nicholson-Sauls" <ibisbasenji gmail.com> Oct 27 2012
- deadalnix <deadalnix gmail.com> Nov 05 2012
- Gor Gyolchanyan <gor.f.gyolchanyan gmail.com> Nov 05 2012
- Gor Gyolchanyan <gor.f.gyolchanyan gmail.com> Nov 05 2012
--e0cb4efe2a0a45be5e04cd03dd40 Content-Type: text/plain; charset=UTF-8 I've stumbled upon this numerous times and I wish I could automate this somehow. The idea is to have some mixin templates mixed into classes automatically when they inherit from some base class. For instance, advanced RTTI methods, which analyze the enclosing class at compile-time. Unfortunately, AFAIK, there's no way of doing it automatically and one needs to both derive from a certain class and mix in a certain mixin template manually. Is there a way to avoid the boilerplate and have it done automatically? -- Bye, Gor Gyolchanyan. --e0cb4efe2a0a45be5e04cd03dd40 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I've stumbled upon this numerous times and I wish I could automate this= somehow.<div>The idea is to have some mixin templates mixed into classes a= utomatically when they inherit from some base class.</div><div>For instance= , advanced RTTI methods, which analyze the enclosing class at compile-time.= </div> <div>Unfortunately, AFAIK, there's no way of doing it automatically and= one needs to both derive from a certain class and mix in a certain mixin t= emplate manually.</div><div>Is there a way to avoid the boilerplate and hav= e it done automatically?<br clear=3D"all"> <div><br></div>-- <br>Bye,<br>Gor Gyolchanyan.<br> </div> --e0cb4efe2a0a45be5e04cd03dd40--
Oct 26 2012
On Saturday, 27 October 2012 at 05:39:59 UTC, Gor Gyolchanyan wrote:I've stumbled upon this numerous times and I wish I could automate this somehow. The idea is to have some mixin templates mixed into classes automatically when they inherit from some base class. For instance, advanced RTTI methods, which analyze the enclosing class at compile-time. Unfortunately, AFAIK, there's no way of doing it automatically and one needs to both derive from a certain class and mix in a certain mixin template manually. Is there a way to avoid the boilerplate and have it done automatically?
Does this give you any ideas on how to solve your use cases: https://github.com/csauls/zeal.d/blob/master/source/zeal/base/controller.d https://github.com/csauls/zeal.d#controllers https://github.com/csauls/zeal.d/blob/master/source/zeal/http/router.d#L93 -- Chris Nicholson-Sauls
Oct 27 2012
Le 27/10/2012 07:39, Gor Gyolchanyan a écrit :I've stumbled upon this numerous times and I wish I could automate this somehow. The idea is to have some mixin templates mixed into classes automatically when they inherit from some base class. For instance, advanced RTTI methods, which analyze the enclosing class at compile-time. Unfortunately, AFAIK, there's no way of doing it automatically and one needs to both derive from a certain class and mix in a certain mixin template manually. Is there a way to avoid the boilerplate and have it done automatically? -- Bye, Gor Gyolchanyan.
I had this need several time too. But I don't think this should be a functionality added in D at this point. This is typically AOP stuff and it is much more interesting for D to think about how to integrate the whole AOP concept instead of hacking around each use case.
Nov 05 2012
--f46d0407166decf5fb04cdc1f021 Content-Type: text/plain; charset=UTF-8 I don't see anything related to this issue. On Sun, Oct 28, 2012 at 5:41 AM, Chris Nicholson-Sauls < ibisbasenji gmail.com> wrote:On Saturday, 27 October 2012 at 05:39:59 UTC, Gor Gyolchanyan wrote:I've stumbled upon this numerous times and I wish I could automate this somehow. The idea is to have some mixin templates mixed into classes automatically when they inherit from some base class. For instance, advanced RTTI methods, which analyze the enclosing class at compile-time. Unfortunately, AFAIK, there's no way of doing it automatically and one needs to both derive from a certain class and mix in a certain mixin template manually. Is there a way to avoid the boilerplate and have it done automatically?
Does this give you any ideas on how to solve your use cases: https://github.com/csauls/**zeal.d/blob/master/source/** zeal/base/controller.d<https://github.com/csauls/zeal.d/blob/master/source/zeal/base/controller.d> https://github.com/csauls/**zeal.d#controllers<https://github.com/csauls/zeal.d#controllers> https://github.com/csauls/**zeal.d/blob/master/source/** zeal/http/router.d#L93<https://github.com/csauls/zeal.d/blob/master/source/zeal/http/router.d#L93> -- Chris Nicholson-Sauls
-- Bye, Gor Gyolchanyan. --f46d0407166decf5fb04cdc1f021 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I don't see anything related to this issue.<div class=3D"gmail_extra"><= br><br><div class=3D"gmail_quote">On Sun, Oct 28, 2012 at 5:41 AM, Chris Ni= cholson-Sauls <span dir=3D"ltr"><<a href=3D"mailto:ibisbasenji gmail.com= " target=3D"_blank">ibisbasenji gmail.com</a>></span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"><div class=3D"HOEnZb"><div class=3D"h5">On S= aturday, 27 October 2012 at 05:39:59 UTC, Gor Gyolchanyan wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> I've stumbled upon this numerous times and I wish I could automate this= <br> somehow.<br> The idea is to have some mixin templates mixed into classes automatically<b= r> when they inherit from some base class.<br> For instance, advanced RTTI methods, which analyze the enclosing class at<b= r> compile-time.<br> Unfortunately, AFAIK, there's no way of doing it automatically and one<= br> needs to both derive from a certain class and mix in a certain mixin<br> template manually.<br> Is there a way to avoid the boilerplate and have it done automatically?<br> </blockquote> <br></div></div> Does this give you any ideas on how to solve your use cases:<br> <a href=3D"https://github.com/csauls/zeal.d/blob/master/source/zeal/base/co= ntroller.d" target=3D"_blank">https://github.com/csauls/<u></u>zeal.d/blob/= master/source/<u></u>zeal/base/controller.d</a><br> <a href=3D"https://github.com/csauls/zeal.d#controllers" target=3D"_blank">= https://github.com/csauls/<u></u>zeal.d#controllers</a><br> <a href=3D"https://github.com/csauls/zeal.d/blob/master/source/zeal/http/ro= uter.d#L93" target=3D"_blank">https://github.com/csauls/<u></u>zeal.d/blob/= master/source/<u></u>zeal/http/router.d#L93</a><span class=3D"HOEnZb"><font= color=3D"#888888"><br> <br> -- Chris Nicholson-Sauls<br> <br> </font></span></blockquote></div><br><br clear=3D"all"><div><br></div>-- <b= r>Bye,<br>Gor Gyolchanyan.<br> </div> --f46d0407166decf5fb04cdc1f021--
Nov 05 2012
--bcaec55405c282511004cdc1f499 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Yeah, I know. Currently bug fixes are way more important then new features and this one really really looks like a dirty hack. But the problem it solves is very real. I honestly don't know what to do about it. On Mon, Nov 5, 2012 at 6:38 PM, deadalnix <deadalnix gmail.com> wrote:Le 27/10/2012 07:39, Gor Gyolchanyan a =C3=A9crit :I've stumbled upon this numerous times and I wish I could automate this somehow. The idea is to have some mixin templates mixed into classes automatically when they inherit from some base class. For instance, advanced RTTI methods, which analyze the enclosing class at compile-time. Unfortunately, AFAIK, there's no way of doing it automatically and one needs to both derive from a certain class and mix in a certain mixin template manually. Is there a way to avoid the boilerplate and have it done automatically? -- Bye, Gor Gyolchanyan.
I had this need several time too. But I don't think this should be a functionality added in D at this point. This is typically AOP stuff and it is much more interesting for D to thin=
about how to integrate the whole AOP concept instead of hacking around ea=
use case.
--=20 Bye, Gor Gyolchanyan. --bcaec55405c282511004cdc1f499 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Yeah, I know. Currently bug fixes are way more important then new features = and this one really really looks like a dirty hack. But the problem it solv= es is very real. I honestly don't know what to do about it.<div class= =3D"gmail_extra"> <br><br><div class=3D"gmail_quote">On Mon, Nov 5, 2012 at 6:38 PM, deadalni= x <span dir=3D"ltr"><<a href=3D"mailto:deadalnix gmail.com" target=3D"_b= lank">deadalnix gmail.com</a>></span> wrote:<br><blockquote class=3D"gma= il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef= t:1ex"> Le 27/10/2012 07:39, Gor Gyolchanyan a =C3=A9crit :<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"><div class=3D"im"> I've stumbled upon this numerous times and I wish I could automate this= <br> somehow.<br> The idea is to have some mixin templates mixed into classes<br> automatically when they inherit from some base class.<br> For instance, advanced RTTI methods, which analyze the enclosing class<br> at compile-time.<br> Unfortunately, AFAIK, there's no way of doing it automatically and one<= br> needs to both derive from a certain class and mix in a certain mixin<br> template manually.<br> Is there a way to avoid the boilerplate and have it done automatically?<br> <br></div> --<br> Bye,<br> Gor Gyolchanyan.<br> </blockquote> <br> I had this need several time too. But I don't think this should be a fu= nctionality added in D at this point.<br> <br> This is typically AOP stuff and it is much more interesting for D to think = about how to integrate the whole AOP concept instead of hacking around each= use case.<br> </blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>Bye,<br>Gor = Gyolchanyan.<br> </div> --bcaec55405c282511004cdc1f499--
Nov 05 2012









"Chris Nicholson-Sauls" <ibisbasenji gmail.com> 