Re: Accessing x86 Performance Counters

2015-05-13 Thread Dmitri Makarov via Digitalmars-d-learn
On Wednesday, 13 May 2015 at 03:38:33 UTC, Maxime Chevalier-Boisvert wrote: I was wondering if anyone has written D code to access the x86 performance counters, to get information such as the number of cache misses and cycle count. Intel made available the source of their performance counter

Re: need help with CTFE

2015-03-26 Thread Dmitri Makarov via Digitalmars-d-learn
On Thursday, 26 March 2015 at 17:30:40 UTC, anonymous wrote: value parameter. You cannot do that, because `name` is a "dynamic value" but you can only pass a "static value" there. (There may be better terms than dynamic/static value.) Thank you, anonymous. It makes sense. I guess rather than

need help with CTFE

2015-03-26 Thread Dmitri Makarov via Digitalmars-d-learn
I'm compiling the following application (2 d modules) // file c/tool.d module c.tool; struct Tool { string name; auto generate() { version (DOES_NOT_WORK) { import std.traits : hasMember; if (hasMember!(Tool, name)) return `writeln("this is a ` ~ mixin ("this."

Re: template instantiation question

2015-03-18 Thread Dmitri Makarov via Digitalmars-d-learn
On Wednesday, 18 March 2015 at 18:26:07 UTC, Ali Çehreli wrote: $ nm b.o | grep transmogrify W _D1c8__T1CTvZ1C12transmogrifyMFNaNbNiNfZi What compiler do you use? For me, neither a.o nor b.o contain transmogrify definition: $ dmd -c -Ix x/i/a.d $ nm a.o | grep trans

template instantiation question

2015-03-18 Thread Dmitri Makarov via Digitalmars-d-learn
I have three modules a.d, b.d, and c.d: file a.d:``` module i.a; import i.c, i.b; final class A { public: void foo() { a.transmogrify(); } S!void a; } ``` -- file b.d:``` module i.b; import i.a, i.c; class B { public: S!void b; } ``` -- file c.d:``` module

deliberately failing compilation when errors are in embedded DSL

2015-02-18 Thread Dmitri Makarov via Digitalmars-d-learn
I'm developing an embedded DSL using CTFE. The DSL code is translated into D code and mixin-ed into the D code of user's application. In order to provide meaningful error messages the DSL compiler always intercepts all errors in the DSL code and reports them at compile-time using pragma(msg, .