Re: DUB: link to local library

2014-09-10 Thread JD via Digitalmars-d-learn
DAllegro5 doesn't have an official dub package yet, but I threw together one that could build the library and added it with `dub add-local`. It now shows up in `dub list`, but adding: "dependencies": { "dallegro5": "~master" } I think I recently saw something like: "dependencies": {

Re: D daemon & GC?

2014-08-31 Thread JD via Digitalmars-d-learn
Last snippet works for me, dots get printed to the logfile as expected. Ok, it works now. Using the recommended _Exit() function with DMD 2.066 on Linux. Thanks you all for your help! Best regards, Jeroen

Re: D daemon & GC?

2014-08-30 Thread JD via Digitalmars-d-learn
I tested it again, and it works fine in both 2.065 and 2.066. Be aware that you should comment out: // close(STDOUT_FILENO); // close(STDERR_FILENO); A daemon normally detaches itself from the terminal by closing the STD* files. All D's runtime exception messages will not appear in

Re: D daemon & GC?

2014-08-30 Thread JD via Digitalmars-d-learn
I can already say that it nevertheless works with DMD git. Will test soon with Digger, unfortunately Bitbucket is currently down, and Digger depends on it. In the meantime I installed DMD 2.066 and I changed the exit() function after the fork as Dicebot suggested. Unfortunately I got the same

Re: D daemon & GC?

2014-08-30 Thread JD via Digitalmars-d-learn
Oops, I accidentally commented out the line allocating the memory in the example code... sorry. // this statement causes core.exception.InvalidMemoryOperationError // auto t = new char[4096]; should read: // this statement causes core.exception.InvalidMemoryOperationError

D daemon & GC?

2014-08-30 Thread JD via Digitalmars-d-learn
Hi all, I tried to write a Linux daemon in D 2.065 (by translating one in C we use at work). My basic skeleton works well. But as soon as I start allocating memory it crashed with several 'core.exception.InvalidMemoryOperationError's. My questions: 1. Are there any special considerations w.

Re: Capture offset of matches in std.regex.matchAll?

2014-07-08 Thread JD via Digitalmars-d-learn
On Tuesday, 8 July 2014 at 15:58:47 UTC, Justin Whear wrote: What do you mean by offset? If you simply mean the index of the match, as your example seems to indicate, you can zip the matches with iota or sequence!"n". If you want the offset in the string where each match begins I think you

Capture offset of matches in std.regex.matchAll?

2014-07-07 Thread JD via Digitalmars-d-learn
I'm using a compile time regex to find some tags in an input string. Is it possible to capture the offset of the matches in some way? Otherwise I have to "calculate" the offsets myself by iterating over the results of matchAll. Thanks, Jeroen --- Example code: import std.stdio; import std.rege