remove keywords

Steven Schveighoffer schveiguy at yahoo.com
Fri Dec 7 07:23:54 PST 2007


"Jarrett Billingsley" wrote
> You tell me which is more readable:
>
> version(linux || darwin || bsd)
>    version = UseDlfcn;
> else
>    version = UseDLLs;
>
> vs.
>
> version(linux)
>    version = UseDlfcn;
> else version(darwin)
>    version = UseDlfcn;
> else version(bsd)
>    version = UseDlfcn;
> else
>    version = UseDLLs;

First one is more readable.

I think maybe the version syntax could be expanded to mean 'or' with commas.
i.e.

version(linux, darwin, bsd)

And forget any other logic syntax (ands, less than, etc).  I believe the 
current method does a good job of preventing convoluted version statements, 
but I think the 'or' is a very common requirement, and does not detract from 
the readability.

-Steve 





More information about the Digitalmars-d mailing list