1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-26 21:20:30 +02:00

Implemented macros in elisp compiler.

* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Implement defmacro and expansion.
* module/language/elisp/runtime/macro-slot.scm: New module to keep definitions.
* test-suite/Makefile.am: Add elisp-compiler.test to list of tests.
* test-suite/tests/elisp-compiler.test: Basic macro tests.
This commit is contained in:
Daniel Kraft 2009-07-16 15:23:38 +02:00
parent b6b9d59604
commit 74c009dadc
5 changed files with 78 additions and 1 deletions

View file

@ -32,6 +32,7 @@ SCM_TESTS = tests/alist.test \
tests/common-list.test \
tests/continuations.test \
tests/elisp.test \
tests/elisp-compiler.text \
tests/environments.test \
tests/eval.test \
tests/exceptions.test \

View file

@ -211,6 +211,19 @@
(zerop a)))))
; Macros.
; =======
(with-test-prefix/compile "Macros"
(pass-if-equal "defmacro value" 'magic-number
(defmacro magic-number () 42))
(pass-if-equal "macro expansion" 1
(progn (defmacro take-first (a b) a)
(take-first 1 (/ 1 0)))))
; Test the built-ins.
; ===================