version(D_Version2)
Gregor Richards
Richards at codu.org
Wed Mar 12 12:42:26 PDT 2008
JMNorris wrote:
> Gregor Richards <Richards at codu.org> wrote in
> news:47D8017C.6000003 at codu.org:
>
>> Alexander Panek wrote:
>>> Preprocessing, probably?
>> Yeah, this is the "simple" way of using the C preprocessor with any
>> language.
>>
>> - Gregor Richards
>
> Maybe someone should write a preprocessor for D, as horrifying as the
> thought may be to some. It should:
>
> 1. Be usable only for conditional compilation. No constants allowed
> outside preprocessing directives and no pseudo-function macros at all.
>
> 2. (Perhaps) work on *.dpp files and generate *.d files.
>
> D's conditional compilation works fine *except* across versions with
> varying syntaxes (such as D1 and D2). If D becomes popular enough to
> support multiple competing commercial compilers, then compiler-specific
> syntax extensions, syntax bugs, and other syntax hiccups will exacerbate
> the problem.
>
> We can keep within 98% of the spirit of Walter's (and mine, for that
> matter) anti-preprocessing bias by keeping defines and D code absolutely
> segregated.
>
I've considered adding preproc support to DSSS for situations like this
one, but I also have the anti-preprocessing bias, and I'm afraid of what
the backlash might be like. Still, there are rare situations (e.g. this
one) where preprocessing is hard to avoid.
- Gregor Richards
More information about the Digitalmars-d
mailing list