On 02/08/2013 02:55, Mike Parker wrote:
<snip>
- Define a mixin template along the lines of __AW in newer versions of MinGW,
so that
version (Unicode) {
alias QwertW Qwert;
} else {
alias QwertA Qwert;
}
can become simply
mixin DECLARE_AW!("Qwert");
I would be cautious about doing this. I know that multiple string mixins can
have a
noticeable impact on compile time. I don't know if that holds to the same scale
for
template mixins, but given the size of the Win32 bindings I would want to be
sure before
implementing it.
Well, I need to use a string mixin to implement it anyway, unless you've found
another way.
I would want to make compile time a top priority. If everyone were always
compiling the bindings as a library, it wouldn't be such a concern. But when
using build
tools which compile imports along with the app source, it can become an issue.
The compiler has to process the content of the bindings source files when using the
bindings, not just when compiling them. Indeed, part of what I'm trying to do is have no
library to build, just as is the case with the C headers.
But all this actually reinforces the points you've made. So maybe I'll give this idea a
miss after all. But maybe when I've a bit more time I'll experiment with it.
But that does suggest that good old C macros are considerably quicker to compile than
mixins. I haven't tried to compare them. I suppose that, now that computers are several
orders of magnitude faster than they were 30 years ago, D has focused on other objectives
than being as fast as possible to compile.
Stewart.
--
My email address is valid but not my primary mailbox and not checked regularly. Please
keep replies on the 'group where everybody may benefit.