Re: Getting the current module as a symbol

2016-04-13 Thread Mithun Hunsur via Digitalmars-d-learn
On Wednesday, 13 April 2016 at 16:58:34 UTC, Vladimir Panteleev wrote: On Wednesday, 13 April 2016 at 11:36:07 UTC, Mithun Hunsur wrote: Yeah, that also works; you have to define a symbol (if you don't have one you can already use) in order to get to it, so it's a little wasteful. Still useful

Re: Getting the current module as a symbol

2016-04-13 Thread Vladimir Panteleev via Digitalmars-d-learn
On Wednesday, 13 April 2016 at 11:36:07 UTC, Mithun Hunsur wrote: Yeah, that also works; you have to define a symbol (if you don't have one you can already use) in order to get to it, so it's a little wasteful. Still useful to know, though! No, it's not necessary. You should be able to walk th

Re: Getting the current module as a symbol

2016-04-13 Thread Mithun Hunsur via Digitalmars-d-learn
On Wednesday, 13 April 2016 at 05:30:27 UTC, Vladimir Panteleev wrote: On Tuesday, 12 April 2016 at 13:44:07 UTC, Mithun Hunsur wrote: Hi all, I'm looking for the equivalent of `typeof(this)` in module scope (so that it gets the current module). My use-case is iterating over the members of th

Re: Getting the current module as a symbol

2016-04-12 Thread Vladimir Panteleev via Digitalmars-d-learn
On Tuesday, 12 April 2016 at 13:44:07 UTC, Mithun Hunsur wrote: Hi all, I'm looking for the equivalent of `typeof(this)` in module scope (so that it gets the current module). My use-case is iterating over the members of the module - right now I'm doing `mixin(iterateOverModule!(module.name.h

Re: Getting the current module as a symbol

2016-04-12 Thread Mithun Hunsur via Digitalmars-d-learn
On Tuesday, 12 April 2016 at 14:22:22 UTC, Adam D. Ruppe wrote: On Tuesday, 12 April 2016 at 13:44:07 UTC, Mithun Hunsur wrote: I'm looking for the equivalent of `typeof(this)` in module scope (so that it gets the current module). The trick I use is `mixin(__MODULE__)`. I also mentioned this

Re: Getting the current module as a symbol

2016-04-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 12 April 2016 at 13:44:07 UTC, Mithun Hunsur wrote: I'm looking for the equivalent of `typeof(this)` in module scope (so that it gets the current module). The trick I use is `mixin(__MODULE__)`. I also mentioned this in my book https://www.packtpub.com/application-development/d-co

Getting the current module as a symbol

2016-04-12 Thread Mithun Hunsur via Digitalmars-d-learn
Hi all, I'm looking for the equivalent of `typeof(this)` in module scope (so that it gets the current module). My use-case is iterating over the members of the module - right now I'm doing `mixin(iterateOverModule!(module.name.here));` but in the interests of keeping the code simple to maint