function | since v0.0-927 | clojure.core/gensym | Edit |
(gensym)
(gensym prefix-string)
Returns a new symbol with a unique name. If a prefix string is supplied, the name is prefix# where # is some unique number. If prefix is not supplied, the prefix is 'G__'.
(defn gensym
([] (gensym "G__"))
([prefix-string]
(when (nil? gensym_counter)
(set! gensym_counter (atom 0)))
(symbol (str prefix-string (swap! gensym_counter inc)))))