hy/tests
Bob Tolbert f5d88bb108 gensym in Hy
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
2013-12-15 12:36:36 -07:00
..
compilers Always import __future__.print_statement in hy code 2013-09-22 15:31:15 +02:00
importer Fix flake error 2013-07-06 20:39:02 +02:00
lex Wire the rply parser 2013-07-28 17:36:36 +02:00
macros Cleanup the hy.macros module 2013-09-29 18:13:28 +02:00
models Make HyList add returns HyList 2013-04-28 17:04:33 +02:00
native_tests gensym in Hy 2013-12-15 12:36:36 -07:00
resources Rewrite the bootstrap macros in hy 2013-09-29 18:13:28 +02:00
__init__.py Add set of new core functions 2013-07-13 09:55:16 -06:00
test_bin.py Merge pull request #328 from berkerpeksag/add-astor 2013-12-11 08:13:03 -08:00