[dmd-beta] Time for a new beta?

Rainer Schuetze r.sagitario at gmx.de
Sat Aug 20 01:39:22 PDT 2011


Hi,

I recently updated to the latest revision from github and tried to 
compile my main project visuald with it. Here are some complications 
that have hit me:

1. My Windows SDK conversion tool converts C macros to templates, e.g.

#define MAKEINTRESOURCEW(i) ((LPWSTR)((ULONG_PTR)((WORD)(i))))

is converted to

auto MAKEINTRESOURCEW(ARG)(ARG i)() { return ( cast(LPWSTR)( 
cast(ULONG_PTR)( cast(WORD)(i)))); }

This no longer works for CTFE, because casts to pointers are no longer 
allowed. Making the argument a template parameter still works, though:

auto MAKEINTRESOURCEW(int i)() { return ( cast(LPWSTR)( cast(ULONG_PTR)( 
cast(WORD)(i)))); }

Also, casting to a pointer is still allowed when initializing a global 
variable at compile time.

Is this by design or a regression?

2. std.regexp is deprecated now, which is good, because there is no 
reason to have two different implementations of regular expressions. 
Unfortunately, std.regex seems to have some problems with rather simple 
regular expressions like r"^(.*)\(([0-9]+)\):(.*)$" that is supposed to 
match error messages like "file.d(37): huhu". std.regexp worked for this 
expression.

Dmitry Olshansky's new std.regex also works, but it does not compile 
with warnings enabled (even not with -wi) ( 
http://d.puremagic.com/issues/show_bug.cgi?id=6518 ).

Maybe it would be better to wait with deprecating std.regexp until there 
is a working alternative.

3. I tried to remove some more (currently soft) deprecation messages 
regarding std.ctype, and it turned out that it was a bit of a hassle to 
get it to compile because I had to mix both std.ascii and std.uni. This 
is happening because I'd like to use the isAlpha from std.uni, but there 
are other functions missing from std.uni (like isDigit, isHexDigit, etc.).

I think this was discussed before, but I'm not sure what the conclusion 
was. I suggest adding some forwarding aliases to std.uni for function 
that have identical implementation, and ensure that the compiler does 
not complain about ambiguities if these are just aliases to the same symbol.

Otherwise, it seems the generated executable works fine.

Rainer



More information about the dmd-beta mailing list