Re: Chars sorting and copies

2011-10-24 Thread Steven Schveighoffer
On Sat, 22 Oct 2011 23:01:17 -0400, bearophile 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 immutable. Isn't that kind of t

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 vers

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]

Re: Chars sorting and copies

2011-10-20 Thread Steven Schveighoffer
On Thu, 20 Oct 2011 21:49:27 -0400, 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 bearophile
Jonathan M Davis: > The elements in a string are immutable. I don't see how the first twe sorts > _ever_ worked, unless it was a bug. Sorry, I meant that it used to work in D1: http://codepad.org/HYdNktNd Later I'll try some of your solutions. Bye, bearophile

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