Re: "version" private word

2017-11-01 Thread Basile B. via Digitalmars-d-learn
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

Re: "version" private word

2017-10-31 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, October 31, 2017 20:36:57 Jacob Carlborg via Digitalmars-d-learn wrote: > On 2017-10-31 16:36, Dr. Assembly wrote: > > thanks. I just find it werid, maybe because I came from C/C++ > > background, where it means only integer types. So enum s = "foo"; is > > really werid. But I'll get

Re: "version" private word

2017-10-31 Thread bauss via Digitalmars-d-learn
On Tuesday, 31 October 2017 at 13:55:56 UTC, Igor Shirkalin wrote: On Tuesday, 31 October 2017 at 13:53:54 UTC, Jacob Carlborg wrote: On 2017-10-31 14:46, Igor Shirkalin wrote: Hello! We need some conditional compilation using 'version'. Say we have some code to be compiled for X86 and

Re: "version" private word

2017-10-31 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-10-31 16:36, Dr. Assembly wrote: thanks. I just find it werid, maybe because I came from C/C++ background, where it means only integer types. So enum s = "foo"; is really werid. But I'll get used to it. Think of it more like #define in C/C++ than "const". The above defines a

Re: "version" private word

2017-10-31 Thread Igor Shirkalin via Digitalmars-d-learn
On Tuesday, 31 October 2017 at 15:19:49 UTC, Steven Schveighoffer wrote: On 10/31/17 10:47 AM, Igor Shirkalin wrote: [...] Sorry I hate writing code on mobile. You can create an arbitrary version by assigning a symbol to it, use that symbol to describe a feature, assign that symbol for

Re: "version" private word

2017-10-31 Thread Dr. Assembly via Digitalmars-d-learn
On Tuesday, 31 October 2017 at 15:20:31 UTC, Igor Shirkalin wrote: On Tuesday, 31 October 2017 at 14:54:27 UTC, Dr. Assembly wrote: On Tuesday, 31 October 2017 at 13:53:54 UTC, Jacob Carlborg wrote: On 2017-10-31 14:46, Igor Shirkalin wrote: [...] The only alternative is to do something

Re: "version" private word

2017-10-31 Thread Igor Shirkalin via Digitalmars-d-learn
On Tuesday, 31 October 2017 at 14:54:27 UTC, Dr. Assembly wrote: On Tuesday, 31 October 2017 at 13:53:54 UTC, Jacob Carlborg wrote: On 2017-10-31 14:46, Igor Shirkalin wrote: [...] The only alternative is to do something like this: version (X86) enum x86 = true; else enum x86 =

Re: "version" private word

2017-10-31 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/31/17 10:47 AM, Igor Shirkalin wrote: On Tuesday, 31 October 2017 at 14:31:17 UTC, Jesse Phillips wrote: On Tuesday, 31 October 2017 at 14:25:19 UTC, Igor Shirkalin wrote: On Tuesday, 31 October 2017 at 14:22:37 UTC, Jesse Phillips wrote: On Tuesday, 31 October 2017 at 13:46:40 UTC,

Re: "version" private word

2017-10-31 Thread Dr. Assembly via Digitalmars-d-learn
On Tuesday, 31 October 2017 at 13:53:54 UTC, Jacob Carlborg wrote: On 2017-10-31 14:46, 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:

Re: "version" private word

2017-10-31 Thread Igor Shirkalin via Digitalmars-d-learn
On Tuesday, 31 October 2017 at 14:31:17 UTC, Jesse Phillips wrote: On Tuesday, 31 October 2017 at 14:25:19 UTC, Igor Shirkalin wrote: On Tuesday, 31 October 2017 at 14:22:37 UTC, Jesse Phillips wrote: On Tuesday, 31 October 2017 at 13:46:40 UTC, Igor Shirkalin wrote: Hello! You goal should

Re: "version" private word

2017-10-31 Thread Jesse Phillips via Digitalmars-d-learn
On Tuesday, 31 October 2017 at 14:25:19 UTC, Igor Shirkalin wrote: On Tuesday, 31 October 2017 at 14:22:37 UTC, Jesse Phillips wrote: On Tuesday, 31 October 2017 at 13:46:40 UTC, Igor Shirkalin wrote: Hello! You goal should be to describe features. Version x86 ... Version = I can stand on

Re: "version" private word

2017-10-31 Thread Igor Shirkalin via Digitalmars-d-learn
On Tuesday, 31 October 2017 at 14:22:37 UTC, Jesse Phillips wrote: On Tuesday, 31 October 2017 at 13:46:40 UTC, Igor Shirkalin wrote: Hello! You goal should be to describe features. Version x86 ... Version = I can stand on my head ... pardon?

Re: "version" private word

2017-10-31 Thread Jesse Phillips via Digitalmars-d-learn
On Tuesday, 31 October 2017 at 13:46:40 UTC, Igor Shirkalin wrote: Hello! You goal should be to describe features. Version x86 ... Version = I can stand on my head ...

Re: "version" private word

2017-10-31 Thread Igor Shirkalin via Digitalmars-d-learn
On Tuesday, 31 October 2017 at 13:53:54 UTC, Jacob Carlborg wrote: On 2017-10-31 14:46, 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:

Re: "version" private word

2017-10-31 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-10-31 14:46, 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" private word

2017-10-31 Thread Igor Shirkalin via Digitalmars-d-learn
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