Re: Problem with code coverage. No .lst files?

2014-04-24 Thread Ali Çehreli via Digitalmars-d-learn
On 04/24/2014 08:32 PM, Jeremy DeHaan wrote: > added the -cov switch to my unit test build Then you must execute the program. :) Ali

Problem with code coverage. No .lst files?

2014-04-24 Thread Jeremy DeHaan via Digitalmars-d-learn
Hey all, I tried to use code coverage analysis for the first time tonight. I added the -cov switch to my unit test build, but no matter what I do, I can't seem to locate the produced .lst files. Is there something I should know that isn't in the docs that I might be doing wrong? I'm not sure

Re: Temporarily protect array from garbage collection

2014-04-24 Thread Lars T. Kyllingstad via Digitalmars-d-learn
On Thursday, 24 April 2014 at 20:09:38 UTC, Justin Whear wrote: You can use GC.addRoot() from core.memory before passing the pointer to the C function, then use GC.removeRoot in your myFree function. Perfect, thanks!

Re: Temporarily protect array from garbage collection

2014-04-24 Thread Justin Whear via Digitalmars-d-learn
On Thu, 24 Apr 2014 19:55:37 +, Lars T. Kyllingstad wrote: > Is it possible to temporarily prevent the garbage collector from > collecting a memory block even if there are no references to it? > > The use case is as follows: I want to call a C library function which > expects to take ownersh

Temporarily protect array from garbage collection

2014-04-24 Thread Lars T. Kyllingstad via Digitalmars-d-learn
Is it possible to temporarily prevent the garbage collector from collecting a memory block even if there are no references to it? The use case is as follows: I want to call a C library function which expects to take ownership of a buffer. It looks something like this: alias FreeFunc =

Re: Partial ordering of constructors with type parameters

2014-04-24 Thread monarch_dodra via Digitalmars-d-learn
On Thursday, 24 April 2014 at 10:12:15 UTC, Andrej Mitrovic via Digitalmars-d-learn wrote: On 4/24/14, monarch_dodra via Digitalmars-d-learn wrote: *That* creates a conflict though :/ Are you sure? I can't reproduce. Weird. I can't either. I probably accidentally tested it on 2.063? Who ca

Re: Example of parse whole json answer.

2014-04-24 Thread Craig Dillabaugh via Digitalmars-d-learn
On Thursday, 24 April 2014 at 12:17:42 UTC, Nicolas wrote: I have a json string saved in a file ( example of json tweeter answer: https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline ). I am trying to read the whole json answer and print specific data ("created_at", "retweet_count",

Example of parse whole json answer.

2014-04-24 Thread Nicolas via Digitalmars-d-learn
I have a json string saved in a file ( example of json tweeter answer: https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline ). I am trying to read the whole json answer and print specific data ("created_at", "retweet_count", ..) . I am new at D Programming language and i was wonderi

Re: Partial ordering of constructors with type parameters

2014-04-24 Thread Andrej Mitrovic via Digitalmars-d-learn
On 4/24/14, monarch_dodra via Digitalmars-d-learn wrote: > *That* creates a conflict though :/ Are you sure? I can't reproduce.

Re: On Concurrency

2014-04-24 Thread Bienlein via Digitalmars-d-learn
One key difference is that coroutines won't make your programs run faster. It is a modelling mechanism that can simplify your programs where you otherwise would have to implement a state machine. This is also my impression when I look at this code (see http://www.99-bottles-of-beer.net/lang