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:
parent
b6b9d59604
commit
74c009dadc
5 changed files with 78 additions and 1 deletions
|
@ -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 \
|
||||
|
|
|
@ -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.
|
||||
; ===================
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue