mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
Improve error checking in 'define-public' and 'module-add!'.
* module/ice-9/boot-9.scm (module-add!): Check that the symbol argument is actually a symbol. (define-public): Expand into 'define' in such a way that curried definitions will immediately fail.
This commit is contained in:
parent
1fcf690929
commit
df3acd296e
1 changed files with 3 additions and 1 deletions
|
@ -2248,6 +2248,8 @@ VALUE."
|
|||
(define (module-add! m v var)
|
||||
(if (not (variable? var))
|
||||
(error "Bad variable to module-add!" var))
|
||||
(if (not (symbol? v))
|
||||
(error "Bad symbol to module-add!" v))
|
||||
(module-obarray-set! (module-obarray m) v var)
|
||||
(module-modified m))
|
||||
|
||||
|
@ -3582,7 +3584,7 @@ CONV is not applied to the initial value."
|
|||
(syntax-rules ()
|
||||
((_ (name . args) . body)
|
||||
(begin
|
||||
(define name (lambda args . body))
|
||||
(define (name . args) . body)
|
||||
(export name)))
|
||||
((_ name val)
|
||||
(begin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue