Permitted locations of a version condition

Rainer Deyke rainerd at eldwood.com
Fri Oct 30 01:19:28 PDT 2009


Phil Deets wrote:
> mixin(q"ENUM
> enum Tag
> {
>    A, B,
> ENUM"~(Version!("symbol")?q"ENUM
>    C, D,
> ENUM":"")~q"ENUM
>    E,
> }
> ENUM");
> 
> That's not pretty, but it's good enough for me; so I'll probably not do
> any compiler hacking.

"Not pretty" is putting it very lightly.

What's happening in the D community is the same thing that's already
happened in the C++ community:
  - The language is missing some useful features.
  - The language is also missing an elegant powerful macro system that
could be used to add those features.
  - However, the language has other features that can be abused to
provide the functionality in a syntactically ugly way.
  - D programmers use these language features to write powerful but ugly
code.
  - The language develops a reputation for being overly complex and
difficult to read.

What makes this case particularly bad is that Walter deliberate chose to
limit the power of the 'version' construct in order to prevent overly
complex read-only code.


-- 
Rainer Deyke - rainerd at eldwood.com



More information about the Digitalmars-d mailing list