Hi
I am trying to write some code that uses and matches to regular
expressions at compile time, but the compiler won't let me
because matchFirst and matchAll make use of malloc().
Is there an alternative that I can use that can be run at compile
time?
Thanks in advance.
Jason
On Monday, 14 July 2014 at 11:43:01 UTC, Philippe Sigaud via
Digitalmars-d-learn wrote:
You can try Pegged, a parser generator that works at
compile-time
(both the generator and the generated parser).
I did, and I got it to work. Unfortunately, the code used to in
the CTFE is left in the
On Tuesday, 15 July 2014 at 12:20:57 UTC, Puming wrote:
@property immutable(T) freeze(T)(T obj)
{
return cast(immutable(T))(obj);
}
What is the idiomatic approach to do this in D?
There is a Phobos function std.exception.assumeUnique which
performs this for arrays. According to
I have this piece of code:
template somet(R...) {
static if (R.length)
{
string somet = [\n~R[0]~\n ~ somet!(R[1..R.length]) ~
]\n;
}
else
string somet = ;
}
void main()
{
writeln(somet!(name,tame));
writeln(somet!name);
}
When I compile it, it generates the error
Hi.
Package in question: fpdf
Dub version I'm using: 0.9.22
DMD version: 2.066.1 (64 bit)
Platform: Fedora 19 (64-bit).
I created the fpdf package, and it is dependant on the
imageformats package, but it won't compile. When I place a copy
of imageformats.d into the project source directory,
Hi
I noticed that in 32bit, many Phobos functions use int and uint,
while in 64bit, they use long and ulong. As a result I am having
some difficulty in writing code that works for both 32 bit and 64
bit. Is there an existing mechanism that allows writing code that
will work in both 32 bit