Re: Parse File at compile time, but not embedded

2016-06-06 Thread Mithun Hunsur via Digitalmars-d-learn
On Monday, 6 June 2016 at 21:57:20 UTC, Pie? wrote: On Monday, 6 June 2016 at 21:31:32 UTC, Alex Parrill wrote: On Monday, 6 June 2016 at 17:31:52 UTC, Pie? wrote: Is it possible to parse a file at compile time without embedding it into the binary? I have a sort of "configuration" file that

Re: standard alias for a class name inside the class code?

2016-05-28 Thread Mithun Hunsur via Digitalmars-d-learn
On Sunday, 29 May 2016 at 00:14:17 UTC, dan wrote: Is there a standard alias for a class name inside class code? Something like 'this' referring to a class instance, but referring instead to the class itself? [...] typeof(this) gets you the type of the current class. :)

Re: Asio Bindings?

2016-06-01 Thread Mithun Hunsur via Digitalmars-d-learn
On Thursday, 2 June 2016 at 04:02:36 UTC, Pie? wrote: Does anyone know if there is any Asio bindings or direct D available that allows for IO? Check out vibe.d: https://vibed.org/ - it includes a fairly complete implementation of asynchronous I/O, among other things.

Re: Why does std.container.array does not work with foraech( i, a; array ) {} ?

2016-05-29 Thread Mithun Hunsur via Digitalmars-d-learn
On Sunday, 29 May 2016 at 09:07:07 UTC, Jonathan M Davis wrote: On Sunday, May 29, 2016 07:14:12 ParticlePeter via Digitalmars-d-learn wrote: [...] std.container.array.Array works with foreach via ranges. foreach(e; myContainer) { } gets lowered to foreach(e; myContainer[]) { } which in

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-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

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

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

Using a string generated at compile-time in a @nogc function

2016-04-30 Thread Mithun Hunsur via Digitalmars-d-learn
Hi all, I'm working on removing the string mixins from my code, but have run into an issue: http://dpaste.dzfl.pl/ecd7eb53947e As far as I can tell, this should work; the enum should force compile-time execution (which it does, as evidenced by the pragma). I've worked around this by

Re: Using a string generated at compile-time in a @nogc function

2016-05-01 Thread Mithun Hunsur via Digitalmars-d-learn
On Sunday, 1 May 2016 at 08:14:43 UTC, Nicholas Wilson wrote: On Sunday, 1 May 2016 at 05:28:36 UTC, Mithun Hunsur wrote: Hi all, I'm working on removing the string mixins from my code, but have run into an issue: http://dpaste.dzfl.pl/ecd7eb53947e As far as I can tell, this should work;

Re: Using a string generated at compile-time in a @nogc function

2016-05-01 Thread Mithun Hunsur via Digitalmars-d-learn
On Sunday, 1 May 2016 at 10:37:23 UTC, Anonymouse wrote: On Sunday, 1 May 2016 at 05:28:36 UTC, Mithun Hunsur wrote: Hi all, I'm working on removing the string mixins from my code, but have run into an issue: http://dpaste.dzfl.pl/ecd7eb53947e As far as I can tell, this should work; the