On 05/02/2012 08:27 AM, Jabb wrote:
> Alone this works just fine. But if I add another file called myalgs.d,
> and put the following in it:
>
> //--
> module myalgs;
> import std.algorithm;
> //--
>
> Then I get the following exception:
>
> object.Error: Access Vio
On 03/21/2013 01:02 PM, Stefan wrote:
> On Wednesday, 2 May 2012 at 15:27:58 UTC, Jabb wrote:
>
>> import std.algorithm;
>> void main() {
>> uint[string] counts = [ "a":4, "b":5, "c":3, "d":1 ];
>> string[] keys = counts.keys;
>>
>> sort!((a, b) { return counts[a] > counts[b]; })(keys);
>> }
>
> D
On Wednesday, 2 May 2012 at 15:27:58 UTC, Jabb wrote:
import std.algorithm;
void main() {
uint[string] counts = [ "a":4, "b":5, "c":3, "d":1 ];
string[] keys = counts.keys;
sort!((a, b) { return counts[a] > counts[b]; })(keys);
}
Did you try
string[] keys = counts.keys
On Wed, 02 May 2012 11:27:57 -0400, Jabb wrote:
Just got the TDPL book and it's a great read! I learn best when typing
out the code myself, so I decided to make a single VisualD project and
put the different exercises in separate modules. I am having problems
with sort in std.algorithms -
Just got the TDPL book and it's a great read! I learn best when
typing out the code myself, so I decided to make a single VisualD
project and put the different exercises in separate modules. I am
having problems with sort in std.algorithms - well, actually it
appears to be a closure problem whe