Re: writeln, alias this and dynamic arrays.

2017-11-22 Thread matthewh via Digitalmars-d-learn
Thank you all for the helpful responses. I will read more about ranges.

Re: writeln, alias this and dynamic arrays.

2017-11-17 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/17/17 8:13 AM, Adam D. Ruppe wrote: On Friday, 17 November 2017 at 06:57:16 UTC, Michael V. Franklin wrote: Actually, it looks like it's this 4-year old bug. https://issues.dlang.org/show_bug.cgi?id=9506 Yeah, I suspected this is old and my comment in there still applies... It passes

Re: writeln, alias this and dynamic arrays.

2017-11-17 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 17 November 2017 at 06:57:16 UTC, Michael V. Franklin wrote: Actually, it looks like it's this 4-year old bug. https://issues.dlang.org/show_bug.cgi?id=9506 Yeah, I suspected this is old and my comment in there still applies... It passes the isInputRange test due to the implicit

Re: writeln, alias this and dynamic arrays.

2017-11-16 Thread Michael V. Franklin via Digitalmars-d-learn
On Friday, 17 November 2017 at 02:13:54 UTC, matthewh wrote: [...] as is it produces: [1, 2, 3, 4, 5, 6, 7, 8] [] I expected it to produce: [1, 2, 3, 4, 5, 6, 7, 8] [1, 2, 3, 4, 5, 6, 7, 8] And with the toString override included it does. Why does the version without the toString override

Re: writeln, alias this and dynamic arrays.

2017-11-16 Thread Michael V. Franklin via Digitalmars-d-learn
On Friday, 17 November 2017 at 02:16:35 UTC, Michael V. Franklin wrote: On Friday, 17 November 2017 at 02:13:54 UTC, matthewh wrote: And with the toString override included it does. Why does the version without the toString override output an empty array? I think that is due to this bug:

Re: writeln, alias this and dynamic arrays.

2017-11-16 Thread Michael V. Franklin via Digitalmars-d-learn
On Friday, 17 November 2017 at 02:13:54 UTC, matthewh wrote: And with the toString override included it does. Why does the version without the toString override output an empty array? I think that is due to this bug: https://issues.dlang.org/show_bug.cgi?id=13189 It's actually on my todo

writeln, alias this and dynamic arrays.

2017-11-16 Thread matthewh via Digitalmars-d-learn
I am new to D and have been fiddling with bits and pieces. I have this code: import std.stdio : writeln; import std.format : format; class Base { override { //string toString() //{ // return format("%s", store); //} } ubyte[] store; alias