Skip to content

Instantly share code, notes, and snippets.

@alexy
Forked from swannodette/str-to-int.clj
Created March 28, 2010 03:07
Show Gist options
  • Save alexy/346533 to your computer and use it in GitHub Desktop.
Save alexy/346533 to your computer and use it in GitHub Desktop.
(def m (ref {}))
(defn str-to-int [m s]
(or (@m s)
(dosync
(alter m assoc s (count @m))
(@m s))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment