summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2013-08-23 01:57:50 -0400
committerMark H Weaver <mhw@netris.org>2013-08-23 02:00:08 -0400
commit0ac084bf2b0b0d7dcae4c5f27477f5af0374d6e5 (patch)
tree81e8a48689abde0a54cf81b2b6a4f13caf7aa5aa
parentdf3acd296e7149630fd6030aced6331ae6dd424b (diff)
downloadguile-0ac084bf2b0b0d7dcae4c5f27477f5af0374d6e5.tar.gz
Fix 'define-public' from (ice-9 curried-definitions).
* 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.
-rw-r--r--module/ice-9/curried-definitions.scm27
1 files changed, 10 insertions, 17 deletions
diff --git a/module/ice-9/curried-definitions.scm b/module/ice-9/curried-definitions.scm
index 8c684a18c..fa369906c 100644
--- a/module/ice-9/curried-definitions.scm
+++ b/module/ice-9/curried-definitions.scm
@@ -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
@@ -21,32 +21,25 @@
(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)