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
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
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]
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;
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
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