obj file for mixin?
Daniel Keep
daniel.keep+lists at gmail.com
Fri Jan 12 04:00:51 PST 2007
Tim Keating wrote:
> This may seem like a dumb question but . . . a source file that is
> imported solely for a template that gets used as a mixin will not be
> compiled into an obj file, correct? The more I think about this, the
> more it seems like the logical behavior, but MAN did it freak me out
> when I noticed its absence from my build directory. ("How in the hell
> did I link that code in there?!?")
>
> TK
Actually, some people have used this very behaviour to do some very cool
(and kinda scary) shell scripting with D.
The idea is that you write your scripting libraries as template mixins,
then use "dmd -run" to run your .d file as a script. If you're on a
*NIX, you can even then use a hashbang. D's also fast enough that
compiling the script every time isn't a big deal.
You certainly wouldn't want to try it with C :3
-- Daniel
More information about the Digitalmars-d
mailing list