Fix 'define-public' from (ice-9 curried-definitions).
authorMark H Weaver <mhw@netris.org>
Fri, 23 Aug 2013 05:57:50 +0000 (01:57 -0400)
committerMark H Weaver <mhw@netris.org>
Fri, 23 Aug 2013 06:00:08 +0000 (02:00 -0400)
* module/ice-9/curried-definitions.scm (cdefine, cdefine*): Simplify,
  and improve error reporting by making the patterns more strict.
  (define-public): Fix bug in generated 'export' form.

module/ice-9/curried-definitions.scm

index 8c684a1..fa36990 100644 (file)
@@ -1,4 +1,4 @@
-;;; Copyright (C) 2010  Free Software Foundation, Inc.
+;;; Copyright (C) 2010, 2013  Free Software Foundation, Inc.
 ;;;
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
 
 (define-syntax cdefine
   (syntax-rules ()
-    ((_ ((head . tail) . rest) body body* ...)
-     (cdefine (head . tail)
-       (lambda rest body body* ...)))
     ((_ (head . rest) body body* ...)
-     (define head
+     (cdefine head
        (lambda rest body body* ...)))
-    ((_ . rest)
-     (define . rest))))
+    ((_ name val)
+     (define name val))))
 
 (define-syntax cdefine*
   (syntax-rules ()
-    ((_ ((head . tail) . rest) body body* ...)
-     (cdefine* (head . tail)
-       (lambda* rest body body* ...)))
     ((_ (head . rest) body body* ...)
-     (define* head
+     (cdefine* head
        (lambda* rest body body* ...)))
-    ((_ . rest)
-     (define* . rest))))
+    ((_ name val)
+     (define* name val))))
 
 (define-syntax define-public
   (syntax-rules ()
-    ((_ (name . args) . body)
-     (begin
-       (cdefine (name . args) . body)
-       (export name)))
+    ((_ (head . rest) body body* ...)
+     (define-public head
+       (lambda rest body body* ...)))
     ((_ name val)
      (begin
        (define name val)