Hy fork
Go to file
Bob Tolbert c80e3c75a0 Adding automatic gensym macro
Adding to the manual gensym for macros are 2 new
macros, but very literal from the CL in
letoverlambda.

The first is the (with-gensyms ...) macro that
can generate a small set of syms for a macro. Works
something like:

(defmacro adder2 [A B]
  (with-gensyms [a b]
    `(let [[~a ~A] [~b ~B]]
       (+ ~a ~b))))

and ~a and ~b will be replaced with (gensym "a") and
(gensym "b") respectively.

Then the final macro is a new defmacro that will automatically
replace symbols prefaced with "g!" with a new gensym based on the
rest of the symbol. So in this final version of 'nif':

(defmacro/g! nif4 (expr pos zero neg)
  `(let [[~g!result ~expr]]
     (cond [(pos? ~g!result) ~pos]
           [(zero? ~g!result) ~zero]
           [(neg? ~g!result) ~neg])))

all uses of ~g!result will be replaced with (gensym "result").
2013-12-15 18:47:46 -07:00
bin Provide bin scripts for both Windows and *nix 2013-07-14 09:06:42 -06:00
docs Add versionadded directive to cli.rst. 2013-12-06 07:51:32 +02:00
eg Removing this file because it's nonfree. 2013-12-01 09:43:45 -05:00
hy Adding automatic gensym macro 2013-12-15 18:47:46 -07:00
tests Adding automatic gensym macro 2013-12-15 18:47:46 -07:00
.coveragerc Adding support for coverage tests at coveralls 2013-12-03 01:58:35 +05:30
.gitignore Provide bin scripts for both Windows and *nix 2013-07-14 09:06:42 -06:00
.travis.yml Adding support for coverage tests at coveralls 2013-12-03 01:58:35 +05:30
AUTHORS Adds try-hy to the docs 2013-12-05 23:07:46 +05:30
LICENSE Removing my name from the license. 2013-04-05 20:04:36 -04:00
make.bat Provide bin scripts for both Windows and *nix 2013-07-14 09:06:42 -06:00
Makefile Adding support for coverage tests at coveralls 2013-12-03 01:58:35 +05:30
NEWS Translate all foo? -> is_foo. Close #334 2013-12-01 15:03:31 -05:00
README.md Merge branch 'master' into pr/347 2013-12-02 23:41:54 -05:00
requirements-dev.txt Removed duplicate flake8 since it has moved into requirements.txt 2013-08-24 11:24:25 -06:00
requirements.txt Update requirements.txt and setup.py to use rply upstream. 2013-12-08 07:11:42 +02:00
setup.cfg Adding in some basic bits in 2013-03-02 20:58:58 -05:00
setup.py Add astor to install_requires. 2013-12-10 17:46:45 +02:00
tox.ini Add rply to dependencies 2013-07-28 17:36:36 +02:00

Hy

Lisp and Python should love each other. Let's make it happen. Try it.

Build Status Downloads version Coverage Status

Hylarious Hacks

Django + Lisp

Python sh fun

Hy IRC bot

OK, so, why?

Well. Python is awesome. So awesome, that we have so many tools to alter the languge in a core way, but we never use them.

Why?

Well, I wrote Hy to help people realize one thing about Python:

It's really goddamn awesome.

Oh, and lisps are neat.

(fan art from the one and only doctormo)

Project