From df3acd296e7149630fd6030aced6331ae6dd424b Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Mon, 19 Aug 2013 19:30:42 -0400 Subject: [PATCH] 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. --- module/ice-9/boot-9.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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