Why version() ?
Don
nospam at nospam.com
Tue Feb 10 06:14:00 PST 2009
Derek Parnell wrote:
> On Tue, 10 Feb 2009 13:08:03 +0100, Don wrote:
>
>> A&&B is not so terrible, since you can do it by nesting, as above.
>> The big problem is A || B. It creates a mess.
>
> version(A) version = AorB;
> version(B) version = AorB;
> version(AorB) {
> . . .
> }
>
Yes. And that sucks, because you've got the version statement in two
places. And you've had to create an essentially meaningless temporary.
[1] Then when you have a more complex expression, especially where A and
B appear more than once, it gets disgusting.
[1] I know Walter's idea is that you create meaningful identifiers, but
in practice this kind of versioning can be a workaround. EG B is
"everything except WindowsME".
More information about the Digitalmars-d
mailing list