On Tuesday, 31 October 2017 at 13:46:40 UTC, Igor Shirkalin wrote:
Hello!

We need some conditional compilation using 'version'.
Say we have some code to be compiled for X86 and X86_64.
How can we do that using predefined (or other) versions?
Examples:

   version(X86 || X86_64) // failed
   version(X86) || version(X86_64) // failed


The following works but it is too verbose:

version(X86) {
        version = X86_or_64;
}
version(X86_64) {
        version = X86_or_64;
}


 - IS

I've implemented this in my PL:

https://github.com/BBasile/yatol/blob/master/src/yatol/semantic/versions.d
https://github.com/BBasile/yatol/blob/master/grammar/formal/peg.txt#L53


You will never see it in D for some reason, which is that Bright think that it's bug prone and easier to read (correct me if i'm wrong)

Reply via email to