Version Identifiers for Platforms / Architectures not supported byDMD
Daniel Murphy
yebblies at nospamgmail.com
Tue Nov 8 17:29:21 PST 2011
There is always one backwards compatible solution:
We could make version identifiers case insensitive.
It's a change from everywhere else in the language, but...
There is no 'correct' casing for os/architecture etc
windows vs Windows, linux vs Linux, x86 vs X86 are meaningless distinctions.
Invalid identifiers are _silently_ accepted.
eg.
version(Linux) {}
Would anybody ever _actually_ mean Linux here?
Because it works on a is/is not defined basis, this is one case where case
sensitivity harms usability. You never get an error for messing up the
casing, unless you explicitly add a static assert in an else clause.
Does anybody really define both 'MyVersion' and 'myVersion' and expect them
to do different things?
I think the inconsistency and the small addition to the spec are worth it to
have the compiler silently and automatically do the right thing, and remove
the impact of some incredibly inconsistent and arbirtary casing choices.
More information about the Digitalmars-d
mailing list