using regex at compiletime

2014-06-15 Thread gedaiu via Digitalmars-d-learn
Hi, I am trying to use regex at compile time for pasing of some html files. The code works perfect at runtime but at compile time i get this error: /usr/include/dmd/phobos/std/regex.d(5824): Error: malloc cannot be interpreted at compile time, because it has no available source code

Re: DMD Fails with fPIC error

2014-06-15 Thread Mike Wey via Digitalmars-d-learn
On 06/14/2014 06:37 PM, Reuben wrote: It looks like the only difference is which version of Phobos we link. I think the reason for this might be that since my version of gcc is hardened, it uses -fPIE by default for linking.

Re: Subclass of Exception

2014-06-15 Thread FreeSlave via Digitalmars-d-learn
I don't think you always need documentation for all exception classes, since the most of them have the same interface. Usually it's worth to describe where is some exception able to be thrown from, not exception itself. And it's covered by function documentation, not by documentation of

Regarding DConf 2014

2014-06-15 Thread Hugo Florentino via Digitalmars-d-learn
Hi, Would it be possible to have for Dconf 2014 something similar to what was made available for DConf 2013 (meaning links to the videos and slides)? Regards, Hugo

Re: Regarding DConf 2014

2014-06-15 Thread Adam D. Ruppe via Digitalmars-d-learn
The videos are being posted at a rate of about two per week. So far talks 1-5 are up plus Scott Meyer's talk, you can find the links in the announce group. http://forum.dlang.org/group/digitalmars.D.announce

Re: Regarding DConf 2014

2014-06-15 Thread Andrew Edwards via Digitalmars-d-learn
On 6/15/14, 8:52 AM, Adam D. Ruppe wrote: The videos are being posted at a rate of about two per week. So far talks 1-5 are up plus Scott Meyer's talk, you can find the links in the announce group. http://forum.dlang.org/group/digitalmars.D.announce Which is great... but why not link them to

Re: Subclass of Exception

2014-06-15 Thread Paul via Digitalmars-d-learn
On Sunday, 15 June 2014 at 09:23:36 UTC, FreeSlave wrote: I don't think you always need documentation for all exception classes, since the most of them have the same interface. Usually it's worth to describe where is some exception able to be thrown from, not exception itself. And it's covered

Re: using regex at compiletime

2014-06-15 Thread Dicebot via Digitalmars-d-learn
AFAIK you can _generate_ regex at compile-time but not actually use it.

Re: Working on a library: request for code review

2014-06-15 Thread Mike via Digitalmars-d-learn
On Friday, 13 June 2014 at 21:09:23 UTC, Mike Wey wrote: On 06/12/2014 09:30 PM, Rene Zwanenburg wrote: I remember a function which does something like only only + canFind on one go. It would look something like header.colorMapDepth.among(16, 32); but I can't find it right now.. Maybe it was

Crash in byCodeUnit() - byDchar() when converting faulty text to HTML

2014-06-15 Thread Nordlöw
I'm using the following snippet to convert a UTF-8 string to HTML /** Convert character $(D c) to HTML representation. */ string toHTML(C)(C c) @safe pure if (isSomeChar!C) { import std.conv: to; if (c == '') return amp;; // ampersand else if (c == '') return lt;; // less than

Re: Crash in byCodeUnit() - byDchar() when converting faulty text to HTML

2014-06-15 Thread Nordlöw
But it triggers See also: https://github.com/nordlow/justd/blob/master/test/t_err.d

How to define and use a custom comparison function

2014-06-15 Thread belkin via Digitalmars-d-learn
I am new to D so I am probably not using the right terminology but here is a piece of C++ code (not complete) that I would like to translate to idiomatic D. I have defined a function object that I pass to std::sort to std:map as follows: enum class SortOrder{ ASC, DESC }; typedef