Re: rdmd main.d leads to Segmentation fault

2018-01-29 Thread Timoses via Digitalmars-d-learn
On Monday, 29 January 2018 at 15:03:48 UTC, Stefan Koch wrote: On Friday, 26 January 2018 at 22:40:29 UTC, Timoses wrote: Hey, simple hello world crashes with segfault: [...] I can not reproduce this. Well, the cause is not yet uncovered, I suppose... Any more ideas?

Re: dmd error - unrecognized file extension

2018-01-29 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Jan 29, 2018 at 02:12:13PM -0500, Steven Schveighoffer via Digitalmars-d-learn wrote: > On 1/29/18 12:25 PM, Evan Burkey wrote: > > Hi there, I have a problem that is eluding me, hoping someone can > > help me see the light. I'm on Windows 10 using the latest version of > > dmd. I have a

Re: dmd error - unrecognized file extension

2018-01-29 Thread Ali Çehreli via Digitalmars-d-learn
On 01/29/2018 12:53 PM, Evan Burkey wrote: On Monday, 29 January 2018 at 19:12:13 UTC, Steven Schveighoffer wrote: version is a keyword, you can't use it here like this. Not sure if this is related to your issue directly, but definitely it will show up as an error when the compiler looks at it

How to proceed with learning to code Windows desktop applications?

2018-01-29 Thread I Lindström via Digitalmars-d-learn
Hello all! I've been doing console apps for about a year and a half now, but my requirements are reaching the limits of easy to use with ASCII-based UI and typed commands so I'm thinking of moving into GUI-era with my projects. I was wondering if some one could help me into the right

Re: dmd error - unrecognized file extension

2018-01-29 Thread Evan Burkey via Digitalmars-d-learn
On Monday, 29 January 2018 at 18:02:47 UTC, rjframe wrote: On Mon, 29 Jan 2018 17:25:34 +, Evan Burkey wrote: Hi there, I have a problem that is eluding me, hoping someone can help me see the light. I'm on Windows 10 using the latest version of dmd. I have a directory with 2 files:

Re: dmd error - unrecognized file extension

2018-01-29 Thread Evan Burkey via Digitalmars-d-learn
On Monday, 29 January 2018 at 19:12:13 UTC, Steven Schveighoffer wrote: version is a keyword, you can't use it here like this. Not sure if this is related to your issue directly, but definitely it will show up as an error when the compiler looks at it properly. So I tried changing the name to

Re: dmd error - unrecognized file extension

2018-01-29 Thread rjframe via Digitalmars-d-learn
On Mon, 29 Jan 2018 17:25:34 +, Evan Burkey wrote: > Hi there, I have a problem that is eluding me, hoping someone can help > me see the light. I'm on Windows 10 using the latest version of dmd. I > have a directory with 2 files: "version.txt" and "versioncheck.d". > version.txt contains a

Re: dmd error - unrecognized file extension

2018-01-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/29/18 12:25 PM, Evan Burkey wrote: Hi there, I have a problem that is eluding me, hoping someone can help me see the light. I'm on Windows 10 using the latest version of dmd. I have a directory with 2 files: "version.txt" and "versioncheck.d". version.txt contains a single line of text. I

cast problem about alias this

2018-01-29 Thread Sobaya via Digitalmars-d-learn
class Parent { int x; alias x this; } class Child : Parent { } void main() { Parent p = new Child; Child c = cast(Child)p; // cannot cast `int` to `Child` } In this code, I got a compile error. How can I cast p to Child?

Re: the behavior of opAssign

2018-01-29 Thread Sobaya via Digitalmars-d-learn
On Monday, 29 January 2018 at 10:06:23 UTC, Simen Kjærås wrote: On Monday, 29 January 2018 at 09:23:55 UTC, Sobaya wrote: I found a strange behavior. class A { void opAssign(int v) {} } class Test { A a; this() { a = new A(); // removing this causes compile error.

Re: cast problem about alias this

2018-01-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/29/18 2:40 PM, Sobaya wrote: class Parent {     int x;     alias x this; } class Child : Parent { } void main() {     Parent p = new Child;     Child c = cast(Child)p; // cannot cast `int` to `Child` } In this code, I got a compile error. How can I cast p to Child? I'm sure I've

Re: Should the "front" range primitive be "const" ?

2018-01-29 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, January 30, 2018 01:05:54 Drone1h via Digitalmars-d-learn wrote: > Hello all, > > > > I am trying to implement a ("struct template" ? what is the > correct word ?) range that just forwards its primitives ("empty", > "front", "popFront") to another range, possibly with some very >

dmd error - unrecognized file extension

2018-01-29 Thread Evan Burkey via Digitalmars-d-learn
Hi there, I have a problem that is eluding me, hoping someone can help me see the light. I'm on Windows 10 using the latest version of dmd. I have a directory with 2 files: "version.txt" and "versioncheck.d". version.txt contains a single line of text. I have the line: immutable version

Re: the behavior of opAssign

2018-01-29 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, January 29, 2018 09:23:55 Sobaya via Digitalmars-d-learn wrote: > I found a strange behavior. > > class A { > void opAssign(int v) {} > } > > class Test { > A a; > this() { > a = new A(); // removing this causes compile error. > a = 3; // cannot

the behavior of opAssign

2018-01-29 Thread Sobaya via Digitalmars-d-learn
I found a strange behavior. class A { void opAssign(int v) {} } class Test { A a; this() { a = new A(); // removing this causes compile error. a = 3; // cannot implicitly convert expression `3` of `int` to `A` } } void main() { // this is allowed. A a;

Re: the behavior of opAssign

2018-01-29 Thread Simen Kjærås via Digitalmars-d-learn
On Monday, 29 January 2018 at 09:23:55 UTC, Sobaya wrote: I found a strange behavior. class A { void opAssign(int v) {} } class Test { A a; this() { a = new A(); // removing this causes compile error. a = 3; // cannot implicitly convert expression `3` of `int` to

Re: questions around mutating range algorithms, const, and return ref

2018-01-29 Thread aliak via Digitalmars-d-learn
On Monday, 29 January 2018 at 06:46:26 UTC, Ali Çehreli wrote: I think the following trivial wrapper around std.algorithm.remove() should do: void removeMatching(R, N)(ref R r, N needles) { import std.algorithm : remove, canFind; r = r.remove!(e => needles.canFind(e)); } Haha

Re: questions around mutating range algorithms, const, and return ref

2018-01-29 Thread Simen Kjærås via Digitalmars-d-learn
On Monday, 29 January 2018 at 11:36:26 UTC, aliak wrote: You don't want to mutate const elements anyway. It would be breaking a promise that other parts of the program may be depending on. I would return a filtered-out range: Right, I want to mutate the range though, not the elements. So

Re: How to proceed with learning to code Windows desktop applications?

2018-01-29 Thread rikki cattermole via Digitalmars-d-learn
On 29/01/2018 11:56 PM, welkam wrote: On Monday, 29 January 2018 at 22:55:12 UTC, I Lindström wrote: The other way I've been thinking is to do the thing browser-based, but for some reason that doesn't feel right. Well it didnt felt wrong for Microsoft to use modified internet explorer to

Re: How to proceed with learning to code Windows desktop applications?

2018-01-29 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 30 January 2018 at 03:07:38 UTC, rikki cattermole wrote: But since Windows is the only platform mentioned or desired for, everything you need is in WinAPI! It's like saying "everything you need is assembly language" when talking about languages and compilers. Pure WinAPI is a

Re: How to proceed with learning to code Windows desktop applications?

2018-01-29 Thread DanielG via Digitalmars-d-learn
There are far too many options for Windows GUI programming, so we probably need a bit more information about any constraints that are important to you. For example: - do you specifically want something that works well with D? or are you open to other languages? - are you just wanting to

Re: rdmd main.d leads to Segmentation fault

2018-01-29 Thread Stefan Koch via Digitalmars-d-learn
On Friday, 26 January 2018 at 22:40:29 UTC, Timoses wrote: Hey, simple hello world crashes with segfault: [...] I can not reproduce this.

Re: questions around mutating range algorithms, const, and return ref

2018-01-29 Thread Seb via Digitalmars-d-learn
On Monday, 29 January 2018 at 11:36:26 UTC, aliak wrote: On Monday, 29 January 2018 at 06:46:26 UTC, Ali Çehreli wrote: I think the following trivial wrapper around std.algorithm.remove() should do: void removeMatching(R, N)(ref R r, N needles) { import std.algorithm : remove, canFind;

Re: How to proceed with learning to code Windows desktop applications?

2018-01-29 Thread welkam via Digitalmars-d-learn
On Monday, 29 January 2018 at 22:55:12 UTC, I Lindström wrote: The other way I've been thinking is to do the thing browser-based, but for some reason that doesn't feel right. Well it didnt felt wrong for Microsoft to use modified internet explorer to make calculator. You can read more on

Should the "front" range primitive be "const" ?

2018-01-29 Thread Drone1h via Digitalmars-d-learn
Hello all, I am trying to implement a ("struct template" ? what is the correct word ?) range that just forwards its primitives ("empty", "front", "popFront") to another range, possibly with some very limited filtering/alteration, as std.range.Take (just to learn). Initially, the "front"

Re: How to proceed with learning to code Windows desktop applications?

2018-01-29 Thread Patrick Schluter via Digitalmars-d-learn
On Tuesday, 30 January 2018 at 06:25:52 UTC, rikki cattermole wrote: On 30/01/2018 5:47 AM, thedeemon wrote: On Tuesday, 30 January 2018 at 03:07:38 UTC, rikki cattermole wrote: But since Windows is the only platform mentioned or desired for, everything you need is in WinAPI! It's like

Re: How to proceed with learning to code Windows desktop applications?

2018-01-29 Thread rikki cattermole via Digitalmars-d-learn
On 30/01/2018 5:47 AM, thedeemon wrote: On Tuesday, 30 January 2018 at 03:07:38 UTC, rikki cattermole wrote: But since Windows is the only platform mentioned or desired for, everything you need is in WinAPI! It's like saying "everything you need is assembly language" when talking about

Re: cast problem about alias this

2018-01-29 Thread Sobaya via Digitalmars-d-learn
On Monday, 29 January 2018 at 19:59:31 UTC, Steven Schveighoffer wrote: On 1/29/18 2:40 PM, Sobaya wrote: class Parent {     int x;     alias x this; } class Child : Parent { } void main() {     Parent p = new Child;     Child c = cast(Child)p; // cannot cast `int` to `Child` } In this