This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
why is use-modules a macro?
- To: guile at sourceware dot cygnus dot com
- Subject: why is use-modules a macro?
- From: "C. Ray C." <crayc at tomcramer dot org>
- Date: Tue, 14 Mar 2000 12:40:39 -0600
I have been looking through the module system, trying to understand it
(trying to add module support to hobbit) and I came across this in
boot-9.scm:
;; the guts of the use-modules macro. add the interfaces of the named
;; modules to the use-list of the current module, in order
(define (process-use-modules module-names)
(for-each (lambda (module-name)
(let ((mod-iface (resolve-interface module-name)))
(or mod-iface
(error "no such module" module-name))
(module-use! (current-module) mod-iface)))
(reverse module-names)))
(defmacro use-modules modules
`(process-use-modules ',modules))
Why not just define the procedure as use-modules in the first place? The
macro doesn't actually do anything, unless I'm misunderstanding what
defmacro does.