Re: Filter and sort associative array

2019-01-11 Thread Head Scratcher via Digitalmars-d-learn
On Friday, 11 January 2019 at 16:06:48 UTC, Alex wrote: On Friday, 11 January 2019 at 16:02:27 UTC, Head Scratcher wrote: Thank you. This works great. What I don't understand is how a key-value pair ends up being a set of strings. Where did the value of the key-value pair get removed?

Re: Filter and sort associative array

2019-01-11 Thread Alex via Digitalmars-d-learn
On Friday, 11 January 2019 at 16:02:27 UTC, Head Scratcher wrote: Thank you. This works great. What I don't understand is how a key-value pair ends up being a set of strings. Where did the value of the key-value pair get removed? According to the library documentation, the array function

Re: Filter and sort associative array

2019-01-11 Thread Head Scratcher via Digitalmars-d-learn
Thank you. This works great. What I don't understand is how a key-value pair ends up being a set of strings. Where did the value of the key-value pair get removed? According to the library documentation, the array function "allocates an array and initializes it with copies of the elements of

Re: Filter and sort associative array

2019-01-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/11/19 10:20 AM, Head Scratcher wrote: I am just learning D. So far, I am impressed by its elegance and power. I have an associative array bool[string]. I want to filter it by value (!bool), then extract the keys and sort them. I am struggling with the syntax and working with ranges. I

Re: Filter and sort associative array

2019-01-11 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Jan 11, 2019 at 03:20:20PM +, Head Scratcher via Digitalmars-d-learn wrote: > I am just learning D. So far, I am impressed by its elegance and power. > > I have an associative array bool[string]. I want to filter it by value > (!bool), then extract the keys and sort them. I am