![]() Simple implementation of gensym in Hy. Returns a new HySymbol. Usable in macros like: (defmacro nif [expr pos zero neg] (let [[g (gensym)]] `(let [[~g ~expr]] (cond [(pos? ~g) ~pos] [(zero? ~g) ~zero] [(neg? ~g) ~neg])))) This addresses all the general comments about (gensym), and doesn't try to implement "auto-gensym" yet. But clearly the macro approach instead of the pre-processor approach (as described in the letoverlambda (http://letoverlambda.com/index.cl/guest/chap3.html#sec_5) is the way to go |
||
---|---|---|
.. | ||
compilers | ||
importer | ||
lex | ||
macros | ||
models | ||
native_tests | ||
resources | ||
__init__.py | ||
test_bin.py |