diff options
author | Mark H Weaver <mhw@netris.org> | 2013-08-19 19:30:42 -0400 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2013-08-19 20:02:50 -0400 |
commit | df3acd296e7149630fd6030aced6331ae6dd424b (patch) | |
tree | 6dd0267339755ebb162ba0681fd59f0eb8c386db | |
parent | 1fcf690929d3cd5221f4fe95ed79f356be382a43 (diff) | |
download | guile-df3acd296e7149630fd6030aced6331ae6dd424b.tar.gz |
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.
-rw-r--r-- | module/ice-9/boot-9.scm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm index c825b3530..3cd3bdc12 100644 --- a/module/ice-9/boot-9.scm +++ b/module/ice-9/boot-9.scm @@ -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 |