On 04/07/2011 03:07 AM, Ali Çehreli wrote:
Given an array of strings std.string.join() returns a single string:
import std.string;
void main() {
string[] a1 = [hello, red];
string j1 = join(a1, ); // OK
}
But in a program I need an array of mutable arrays of chars. If I join
On 04/07/2011 09:52 AM, spir wrote:
On 04/07/2011 03:07 AM, Ali Çehreli wrote:
Given an array of strings std.string.join() returns a single string:
import std.string;
void main() {
string[] a1 = [hello, red];
string j1 = join(a1, ); // OK
}
But in a program I need an array of mutable arrays
On 04/07/2011 09:52 AM, spir wrote:
On 04/07/2011 03:07 AM, Ali Çehreli wrote:
Given an array of strings std.string.join() returns a single string:
import std.string;
void main() {
string[] a1 = [hello, red];
string j1 = join(a1, ); // OK
}
But in a program I need an array of mutable arrays
On Thu, 07 Apr 2011 02:13:16 +0200, bearophile bearophileh...@lycos.com
wrote:
Given an array of strings std.string.join() returns a single string:
import std.string;
void main() {
string[] a1 = [hello, red];
string j1 = join(a1, ); // OK
}
But in a program I need an array of
On 04/07/2011 01:04 AM, spir wrote:
On 04/07/2011 09:52 AM, spir wrote:
On 04/07/2011 03:07 AM, Ali Çehreli wrote:
Given an array of strings std.string.join() returns a single string:
import std.string;
void main() {
string[] a1 = [hello, red];
string j1 = join(a1, ); // OK
}
But in
spir Wrote:
unittest {
string s = abc;
char[] chars = cast(char[])s;
chars ~= de;
s = cast(string) chars;
writeln(s, ' ', chars); // abcde abcde
chars[1] = 'z';
writeln(s, ' ', chars); // azcde azcde
}
s's chars are mutable ;-) So, I guess there is /really/ no reason for
Jesse Phillips:
Casting to and from string/char[] is very dangerous, even through
assumeUnique. AssumeUnique is intended to be used for returning a mutable as
immutable from a function. Casting is often a no-op for the CPU and as you
discovered removes any safety provided by the type
Given an array of strings std.string.join() returns a single string:
import std.string;
void main() {
string[] a1 = [hello, red];
string j1 = join(a1, ); // OK
}
But in a program I need an array of mutable arrays of chars. If I join the
arrays I get a mutable array of chars. But I
On 04/06/2011 05:13 PM, bearophile wrote:
Given an array of strings std.string.join() returns a single string:
import std.string;
void main() {
string[] a1 = [hello, red];
string j1 = join(a1, ); // OK
}
But in a program I need an array of mutable arrays of chars. If I
join