On Wednesday, 19 February 2014 at 13:07:39 UTC, Suliman wrote:
Hm, I got next error on this code

import std.stdio;
import std.array;

void main()
{
immutable s = ["red", "blue"];
auto js = s.join;
}

This works:

auto s = ["red", "blue"];
auto js = s.join("");

2 issues in your snippet:

1) need to define separator for join
2) fully immutable array can't act is InputRange as one can't popFront from it

Arguably join should have made constraint check on tail-qualified copy of s instead though (as it is legal to copy imutable(char[]) into immutable(char)[]). I bet there is even bugzilla entry for it :)

Reply via email to