Skip to content

Instantly share code, notes, and snippets.

@kremers
Created December 9, 2014 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kremers/4d72fb02a05ad54081be to your computer and use it in GitHub Desktop.
Save kremers/4d72fb02a05ad54081be to your computer and use it in GitHub Desktop.
(def input '([:h1 "test1.1"] [:h2 "test2.1"] [:h3 "test3.1"]
[:h3 "test3.2"] [:h3 "test3.3"] [:h2 "test2.2"]))
(def output '([:ol
[:h1 "test1.1"]
[:ol
[:h2 "test2.1"]
[:ol
[:h3 "test3.1"]
[:h3 "test3.2"]
[:h3 "test3.3"]]
[:h2 "test2.2"]]]))
(comment ideas:)
(def _h [:h1 :h2 :h3 :h4 :h5 :h6])
(defn compare_index [cmp i1 i2] (cmp (.indexOf _h i1) (.indexOf _h i2)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment