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 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) ||

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 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: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?

"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

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 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 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 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 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 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 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 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: Removing some of the elements from vibe.core.concurrency.Future[] futurelist

2017-10-31 Thread kerdemdemir via Digitalmars-d-learn
I'd take a look at why the error message says `Future!(UserData)[]) to Future!(AnalyzeData)[]` is AnalyzeData the type returned by ProcessResponceData? Alternatively you could use a singly linked list and splice out elements that pass the filter predicate. I think you'd have to roll your own

Re: if (int bar = .. bug or some thing

2017-10-31 Thread codephantom via Digitalmars-d-learn
On Tuesday, 31 October 2017 at 04:27:27 UTC, Joel wrote: Ok, thanks guys. why not throw in some UFCS too...just because you can ;-) import std.stdio; void main() { int foo; if (foo.bar != 0) // would be nice if I could do: (int foo.bar != 0) { throw new

Line numbers in backtraces (2017)

2017-10-31 Thread Tobias Pankrath via Digitalmars-d-learn
Hi, I'm using ArchLinux and the recent DMD from the Arch repositories and my backtraces show no line numbers. I now that is an old issue, but I'm back to D after a long pause and I thought that this used to work out of the box. My backtraces look likes this: ??:? pure @safe void

Re: Line numbers in backtraces (2017)

2017-10-31 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 31 October 2017 at 11:04:57 UTC, Tobias Pankrath wrote: [...] ??:? pure @safe void std.exception.bailOut!(Exception).bailOut(immutable(char)[], ulong, const(char[])) [0xab5c9566] ??:? pure @safe bool std.exception.enforce!(Exception, bool).enforce(bool, lazy const(char)[],

Re: using .init reliably

2017-10-31 Thread Alex via Digitalmars-d-learn
On Tuesday, 31 October 2017 at 02:24:48 UTC, Steven Schveighoffer wrote: Yeah... my problem is, that I don't know it at compile time. You know it at language time :) :) The .init property is provided by the compiler, unless you define it. It means the default value of the type. Here, I'm