1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 19:50:24 +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:
Mark H Weaver 2013-08-19 19:30:42 -04:00
parent 1fcf690929
commit df3acd296e

View file

@ -2248,6 +2248,8 @@ VALUE."
(define (module-add! m v var) (define (module-add! m v var)
(if (not (variable? var)) (if (not (variable? var))
(error "Bad variable to module-add!" 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-obarray-set! (module-obarray m) v var)
(module-modified m)) (module-modified m))
@ -3582,7 +3584,7 @@ CONV is not applied to the initial value."
(syntax-rules () (syntax-rules ()
((_ (name . args) . body) ((_ (name . args) . body)
(begin (begin
(define name (lambda args . body)) (define (name . args) . body)
(export name))) (export name)))
((_ name val) ((_ name val)
(begin (begin