From 3c5af9ef9bbd0ba8982b9accc82cb09728fede5e Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Fri, 11 Jul 1997 05:13:59 +0000 Subject: [PATCH] * boot-9.scm (define-public): Changed to accomodate Hobbit. --- ice-9/boot-9.scm | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm index b595bbcf9..cdda674eb 100644 --- a/ice-9/boot-9.scm +++ b/ice-9/boot-9.scm @@ -2488,28 +2488,31 @@ (error "bad syntax" (list 'define-public args))) (define (defined-name n) (cond - ((symbol? n) n) - ((pair? n) (defined-name (car n))) - (else (syntax)))) + ((symbol? n) n) + ((pair? n) (defined-name (car n))) + (else (syntax)))) (cond - ((null? args) (syntax)) + ((null? args) (syntax)) - (#t (let ((name (defined-name (car args)))) - `(begin - (let ((public-i (module-public-interface (current-module)))) - ;; Make sure there is a local variable: - ;; - (module-define! (current-module) - ',name - (module-ref (current-module) ',name #f)) + (#t (let ((name (defined-name (car args)))) + `(begin + (let ((public-i (module-public-interface (current-module)))) + ;; Make sure there is a local variable: + ;; + (module-define! (current-module) + ',name + (module-ref (current-module) ',name #f)) - ;; Make sure that local is exported: - ;; - (module-add! public-i ',name (module-variable (current-module) ',name))) + ;; Make sure that local is exported: + ;; + (module-add! public-i ',name + (module-variable (current-module) ',name))) - ;; Now (re)define the var normally. - ;; - (define-private ,@ args)))))) + ;; Now (re)define the var normally. Bernard URBAN + ;; suggests we use eval here to accomodate Hobbit; it lets + ;; the interpreter handle the define-private form, which + ;; Hobbit can't digest. + (eval '(define-private ,@ args)))))))