Conditional compilation inside asm and enum declarations

Bill Baxter wbaxter at gmail.com
Tue Jul 14 10:22:08 PDT 2009


On Tue, Jul 14, 2009 at 10:01 AM, Walter
Bright<newshound1 at digitalmars.com> wrote:
> Bill Baxter wrote:
>>
>> But from where I sit it looked like Walter didn't really convince
>> anyone.  To me this seems like a point where D is overly patronizing,
>> to use the phrase from a recent post.
>
> You could argue that, but it also took a long time to convince many about
> the merit of const and immutable. I understand that C style versioning is so
> seductive, it's very hard to see what's wrong with it.
>
> (For another reason against such, I could send you some of the source to
> optlink. It's chock full of line by line versioning, nested versioning, a
> couple dozen version arguments, it's so bad the only way I can tell what's
> going on is to compile it then *disassemble* it to see what the code
> actually is.)
>
> Contrast that with the dmd front end source where I've made a concerted
> effort (not 100% yet) to remove #ifdef's.
>
> And I didn't even touch on what would have to happen if versioning could
> slice anywhere - it would have to be done as a separate pre-pass. It
> couldn't be integrated in to the current one-pass parser, and would do a
> fine job of screwing up syntax highlighters and pretty-printers much like
> C's preprocessor can.
>

I wasn't very clear.
I do think you make a convincing argument that in general lots of
micro ifdefs everywhere is not the right approach.
But I remain unconvinced that potential for abuse is a good reason to
disallow finer scale version() statements.  It smacks of the same
patronizing one-size-fits-all attitude of java, where everything has
to be a class because the designers decided that OO==better design.
It just doesn't seem to fit well with the rest of the D attitude of
not getting in the developer's way.

--bb



More information about the Digitalmars-d mailing list