fix defmacro*, defmacro*-public
authorAndy Wingo <wingo@oblong.net>
Wed, 10 Jun 2009 08:53:00 +0000 (10:53 +0200)
committerAndy Wingo <wingo@oblong.net>
Wed, 10 Jun 2009 08:53:22 +0000 (10:53 +0200)
* module/ice-9/boot-9.scm (define-private): Remove apocyphal comment. The
  FIXME would really be to remove `define-private', though...

* module/ice-9/optargs.scm (defmacro*, defmacro*-public): Fix these
  macros. Thanks to Dale Smith for the report.

module/ice-9/boot-9.scm
module/ice-9/optargs.scm

index 78b194a..3d77093 100644 (file)
@@ -2931,8 +2931,6 @@ module '(ice-9 q) '(make-q q-length))}."
     (process-use-modules (list (list ,@(compile-interface-spec spec))))
     *unspecified*))
 
-;; Dirk:FIXME:: This incorrect (according to R5RS) syntax needs to be changed
-;; as soon as guile supports hygienic macros.
 (define-syntax define-private
   (syntax-rules ()
     ((_ foo bar)
index 4dea92f..975703c 100644 (file)
 ;;   (defmacro* transmorgify (a #:optional b)
 
 (defmacro defmacro* (NAME ARGLIST . BODY)
-  (defmacro*-guts 'define NAME ARGLIST BODY))
+  `(define-macro ,NAME #f (lambda* ,ARGLIST ,@BODY)))
 
 (defmacro defmacro*-public (NAME ARGLIST . BODY)
-  (defmacro*-guts 'define-public NAME ARGLIST BODY))
-
-;; The guts of defmacro* and defmacro*-public
-(define (defmacro*-guts DT NAME ARGLIST BODY)
-  `(,DT ,NAME
-       (,(lambda (transformer) (defmacro:transformer transformer))
-        (lambda* ,ARGLIST ,@BODY))))
+  `(begin
+     (defmacro* ,NAME ,ARGLIST ,@BODY)
+     (export-syntax ,NAME)))
 
 ;;; optargs.scm ends here