digitalmars.D - automatic mixin in classes
- Gor Gyolchanyan (13/13) Oct 26 2012 I've stumbled upon this numerous times and I wish I could automate this
- Chris Nicholson-Sauls (7/23) Oct 27 2012 Does this give you any ideas on how to solve your use cases:
- Gor Gyolchanyan (6/25) Nov 05 2012 I don't see anything related to this issue.
- deadalnix (6/19) Nov 05 2012 I had this need several time too. But I don't think this should be a
- Gor Gyolchanyan (9/30) Nov 05 2012 Yeah, I know. Currently bug fixes are way more important then new featur...
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.
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
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:-- Bye, Gor Gyolchanyan.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
Nov 05 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
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 :kI'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=chuse case.--=20 Bye, Gor Gyolchanyan.
Nov 05 2012