Created
January 5, 2015 13:05
-
-
Save kurogelee/f0992d2ead1fc447ac52 to your computer and use it in GitHub Desktop.
挿入した順序を保証するMap, Set ref: http://qiita.com/kurogelee/items/02fdd51c88dc8f2d2be0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[org.flatland/ordered "1.5.2"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns sample-ordered | |
(:use [flatland.ordered.set :only [ordered-set]] | |
[flatland.ordered.map :only [ordered-map]])) | |
(-> (assoc (ordered-map :a 1 :b 2) :c 3 :d 4) | |
(assoc :e 5) | |
(#(apply assoc % (range 20))) | |
keys) | |
(-> (ordered-set :a :b :c 1 2) | |
(conj :d :e) | |
(#(apply conj % (range 20))) | |
seq) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(:a :b :c :d :e 0 2 4 6 8 10 12 14 16 18) | |
(:a :b :c 1 2 :d :e 0 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment