Re: create vectors for each key/value pair

2014-07-22 Thread Alex Walker
First, the fn sorted-map is variable argument and expects to be given (sorted-map :z 1, :b 2, :a 3) and not (sorted-map my-map). To use sorted-map, you'll need to do something like: (apply sorted-map (mapcat identity my-map)) Se

Re: create vectors for each key/value pair

2014-07-22 Thread Marc Limotte
I think you just want: user=> (sort my-map) ([1405960895 20] [1405960927 20] [1405960959 21] [1405960991 20] [1405961023 20] [1405961055 18] [1405961087 23] [1405961119 17] [1405961151 23] [1405961183 19] [1405961215 20] [1405961887 20] [1405961919 20]) sort will call seq on it's argument. The s

create vectors for each key/value pair

2014-07-22 Thread emptya45
Hi, I have an unsorted map: (def my-map {1405961887 20, 1405960895 20, 1405961919 20, 1405960927 20, 1405960959 21, 1405960991 20, 1405961023 20, 1405961055 18, 1405961087 23, 1405961119 17, 1405961151 23, 1405961183 19, 1405961215 20} I'd like to be able to sort the map b