D create many thread

2020-02-05 Thread Eko Wahyudin via Digitalmars-d-learn
Hi all, I'm create a small (hallo world) application, with DMD. But my program create 7 annoying threads when create an empty class. What is this thread for? and is it normal in D? Below the stack trace of thread creation. #0 0x77f637a0 in pthread_create@@GLIBC_2.2.5 () from

Re: How to iterate getSymbolsByUDA

2018-11-27 Thread Eko Wahyudin via Digitalmars-d-learn
static foreach(sym; getSymbolsByUDA!(A, Attr)){ writeln(sym.stringof); // print variable name "a" this what i want } foreach(sym; getSymbolsByUDA!(A, Attr)){ writeln(sym.stringof); // print "sym" } foreach(sym; getSymbolsByUDA!(A, Attr)){ writeln(__traits(identifier,

Re: How to iterate getSymbolsByUDA

2018-11-26 Thread Eko Wahyudin via Digitalmars-d-learn
On Sunday, 25 November 2018 at 01:01:30 UTC, bauss wrote: On Saturday, 24 November 2018 at 08:50:59 UTC, Eko Wahyudin wrote: On Saturday, 24 November 2018 at 08:09:38 UTC, Stanislav Blinov wrote: [...] aah ya,, this statement is work static foreach (i; 0 .. symbols.length) thank you. It

Re: How to iterate getSymbolsByUDA

2018-11-24 Thread Eko Wahyudin via Digitalmars-d-learn
On Saturday, 24 November 2018 at 08:09:38 UTC, Stanislav Blinov wrote: On Saturday, 24 November 2018 at 03:48:12 UTC, Eko Wahyudin wrote: Hi all, anyone know how to iterate getSymbolsByUDA ? enum Attr; struct A { @Attr int a; int b; @Attr void foo() {} @Attr void foo(int) {}

How to iterate getSymbolsByUDA

2018-11-23 Thread Eko Wahyudin via Digitalmars-d-learn
Hi all, anyone know how to iterate getSymbolsByUDA ? I try this code: enum Attr; struct A { @Attr int a; int b; } //--- //1. Error: need `this` for `a` of type `int` foreach(sym; getSymbolsByUDA!(A, Attr)){ writeln(sym.stringof); }

how to make interface with return auto

2017-04-03 Thread Eko Wahyudin via Digitalmars-d-learn
I know it's imposible. is there's a way if i want to create an interface that have method with return type value is equals with return type of std.palallelism.task eg. interface IWorker{ auto activate(); //on implementation class activate return std.parallelism.task } What is the

How delegate context work?

2017-03-16 Thread Eko Wahyudin via Digitalmars-d-learn
I'm writing promise library, and perform testing like this.. app = new Application(); Promise p = app.exec(delegate void(){ // first delegate write("Hello"); std.stdio.stdout.flush; int xxx = 777;