hylang/hy — pull request #374 by rwtolbert (2013-12-15 00:44:48+00:00)
Title: a little gensym love

This is a first attempt as implementing gensym inside macros
much like is done in clojure.

any symbol that ends in a trailing '#' gets replaced with a
new gensym symbol on macro expansion. For example, in:

(defmacro yield-from [iterable]
"Yield all the items from iterable"
`(foreach [x# ~iterable]
(yield x#)))

x# would be replaced with a call to (gensym "x") and would
be replaced with something like 'hy_x_1234' where the
trailing integer is unique across all gensym symbols.
All versions of 'x#' in the same macro would be replaced with
the same gensym symbol.