nlfiedler / bakeneko

Scheme R7RS interpreter in Go
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

Implement hygienic macros #22

Open nlfiedler opened 11 years ago

nlfiedler commented 11 years ago

See section 4.3 of R7RS for a specification on hygienic macros. The Lispy.py code seems to support macros, so adding this feature to that milestone, but also needed for R7RS.

nlfiedler commented 11 years ago

See the explanation of macros on this page [1]. It makes it very clear how macros are to be implemented. Basically the macro takes the given form as-is, does whatever transformations it is intended to do, and the result is in turn evaluated by the reader. The use of ` and , in writing macros is common.

[1] http://prog-elisp.blogspot.ru/2013/10/lisp-for-c-programmers.html

nlfiedler commented 10 years ago

Having macro support will make implementing many of the other features simple, such as many of the derived expressions (e.g. and, cond, let and friends).