Re: Chars sorting and copies

2011-10-24 Thread Steven Schveighoffer
On Sat, 22 Oct 2011 23:01:17 -0400, bearophile bearophileh...@lycos.com wrote: Thanks for all the answers. Steven Schveighoffer: a ~ b should technically be assignable to char[], since it's alread new memory. We may yet get there with pure functions being able to implicit cast to

Re: Chars sorting and copies

2011-10-22 Thread bearophile
Thanks for all the answers. Steven Schveighoffer: a ~ b should technically be assignable to char[], since it's alread new memory. We may yet get there with pure functions being able to implicit cast to immutable. Isn't that kind of the opposite? Is this already in Bugzilla? Some

Re: Chars sorting and copies

2011-10-21 Thread Kagamin
bearophile Wrote: I have many strings and I want to use as associative array kay a sorted concat of two strings (it's a signature of the two strings): import std.algorithm; void main() { string a = red; string b = green; int[string] aa; //aa[(a ~ b).sort] = 1;

Chars sorting and copies

2011-10-20 Thread bearophile
I have many strings and I want to use as associative array kay a sorted concat of two strings (it's a signature of the two strings): import std.algorithm; void main() { string a = red; string b = green; int[string] aa; //aa[(a ~ b).sort] = 1; //aa[(a ~ b).sort.idup] = 1;

Re: Chars sorting and copies

2011-10-20 Thread Jonathan M Davis
On Thursday, October 20, 2011 21:49:27 bearophile wrote: I have many strings and I want to use as associative array kay a sorted concat of two strings (it's a signature of the two strings): import std.algorithm; void main() { string a = red; string b = green; int[string] aa;

Re: Chars sorting and copies

2011-10-20 Thread Steven Schveighoffer
On Thu, 20 Oct 2011 21:49:27 -0400, bearophile bearophileh...@lycos.com wrote: I have many strings and I want to use as associative array kay a sorted concat of two strings (it's a signature of the two strings): import std.algorithm; void main() { string a = red; string b = green;