On Wed, Jul 01, 2015 at 02:14:49PM -0400, Steven Schveighoffer via
Digitalmars-d-learn wrote:
> On 7/1/15 1:44 PM, Steven Schveighoffer wrote:
>
> >Schizophrenia of Phobos.
> >
> >Phobos thinks a string is a range of dchar instead of a range of
> >char. So what cycle, take, and array all output
On 7/1/15 1:44 PM, Steven Schveighoffer wrote:
Schizophrenia of Phobos.
Phobos thinks a string is a range of dchar instead of a range of char.
So what cycle, take, and array all output are dchar ranges and arrays.
When you cast the dchar[] result to a string, (which is a char[]), it
then treat
On Wednesday, 1 July 2015 at 17:00:51 UTC, Taylor Hillegeist
wrote:
When I run the code (compiled on DMD 2.067.1):
--
import std.algorithm;
import std.stdio;
import std.range;
string A="AaA";
string B="BbBb";
string C="CcCcC";
void main(){
On Wednesday, 1 July 2015 at 17:13:03 UTC, Taylor Hillegeist
wrote:
string q = cast(string)
(A.cycle.take(seg1len).array
~B.cycle.take(seg2len).array
~C.cycle.take(seg3len).array);
q.writeln;
I was wondering if it might be the cast?
Yes, the cast is wrong. You're reinterpreting (not
On 7/1/15 1:00 PM, Taylor Hillegeist wrote:
When I run the code (compiled on DMD 2.067.1):
--
import std.algorithm;
import std.stdio;
import std.range;
string A="AaA";
string B="BbBb";
string C="CcCcC";
void main(){
int L=25;
int se
On Wednesday, 1 July 2015 at 17:06:01 UTC, Adam D. Ruppe wrote:
I betcha it is because A, B, and C are modified by the first
pass. A lot of the range functions consume their input.
Running them one at a time produces the same result.
for some reason:
(A.cycle.take(seg1len).array
~B.cycle.
I betcha it is because A, B, and C are modified by the first
pass. A lot of the range functions consume their input.
When I run the code (compiled on DMD 2.067.1):
--
import std.algorithm;
import std.stdio;
import std.range;
string A="AaA";
string B="BbBb";
string C="CcCcC";
void main(){
int L=25;
int seg1len=(L-B.length)/2;
int seg2len=B.lengt