mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-19 19:20:23 +02:00
* module/language/scheme/translate.scm (¤t-macros): Removed. (¤t-macro-module): Removed. (&compile-time-module): New. (eval-at-compile-time): New. (translate): Initialize `&compile-time-module'. (expand-macro)[use-syntax]: New case. [begin let...]: Don't expand these built-in macros. [else]: Rewrote the macro detection and invocation logic. Invoke macro transformers in the current compile-time module. (trans): Let `expand-macro' raise an exception if needed. (trans-pair)[defmacro define-macro]: Evaluate the macro definition in the compile-time module. * testsuite/t-match.scm: Use `use-syntax' instead of `use-modules' for `(ice-9 match)' and `(srfi srfi-9)'. * testsuite/t-records.scm: Likewise. git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-15
25 lines
693 B
Scheme
25 lines
693 B
Scheme
;;; SRFI-9 Records.
|
||
;;;
|
||
|
||
;; SRFI-9 is a compile-time dependency (it exports the `define-record-type'
|
||
;; macro), hence the `use-syntax'.
|
||
;;
|
||
;; FIXME: The current definition of `use-syntax' in `boot-9.scm' is broken
|
||
;; and is not consistent with what happens when using:
|
||
;;
|
||
;; (define-module (module) :use-syntax (chbouib))
|
||
;;
|
||
;; This precludes the test-suite from running this program using the
|
||
;; interpreter.
|
||
(use-syntax (srfi srfi-9))
|
||
|
||
(define-record-type <stuff>
|
||
(%make-stuff chbouib)
|
||
stuff?
|
||
(chbouib stuff:chbouib stuff:set-chbouib!))
|
||
|
||
|
||
(and (stuff? (%make-stuff 12))
|
||
(= 7 (stuff:chbouib (%make-stuff 7)))
|
||
(not (stuff? 12))
|
||
(not (false-if-exception (%make-stuff))))
|