mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
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.
This commit is contained in:
parent
df3acd296e
commit
0ac084bf2b
1 changed files with 10 additions and 17 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue