OpenBSD port of dmd?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Mar 16 17:53:45 PDT 2012


On 3/16/12 7:45 PM, Daniel Murphy wrote:
> You can do that just as well without using an 'else' block.
>
> version(ThisOS)
> {
>     doItThisWay();
> }
> else version(ThatOS)
> {
>     doItThatWay();
> }
> else version(SomeOS)
> {
>     doItSlowWay();
> }
> else version(OtherOS)
> {
>     doItSlowWay();
> }
> else
>     static assert(0, "OS not implemented");

But why duplicate doItSlowWay(); which may be an arbitrarily long sequence?

This seems to accomplish little more than "well I didn't use else".

Again: what exactly is wrong with specialization?


Andrei


More information about the Digitalmars-d mailing list