hy/tests/native_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
..
2013-03-05 18:39:34 -05:00
2013-12-15 12:36:36 -07:00
2013-10-11 01:49:42 +02:00
2013-12-15 12:36:36 -07:00
2013-09-22 15:12:59 +02:00
2013-04-28 17:04:35 +02:00
2013-04-28 17:04:35 +02:00