Skip to content

Instantly share code, notes, and snippets.

@MichaelDrogalis
Created August 27, 2013 16:25
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 MichaelDrogalis/316a1b929cb802cb6777 to your computer and use it in GitHub Desktop.
Save MichaelDrogalis/316a1b929cb802cb6777 to your computer and use it in GitHub Desktop.
(defn make-key [] (gensym (keyword "key-")))
(map type (keys m)) ;;; => (clojure.lang.Symbol clojure.lang.Symbol clojure.lang.Symbol)
@gdeer81
Copy link

gdeer81 commented Aug 30, 2013

was trying to reproduce the bug so I had to write make-key myself.

(defn make-key [] (keyword (str "key-" (rand-int 9000))))

was upset that I couldn't reproduce the bug until I realized the missing piece probably was the bug
second crack at it using gensym

(defn make-key2 [] (keyword (gensym "key-"))) 

that was fun

edit: forgot to markdown codeblocks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment