From d866f4455b36c992fe9010724fcc880de24084a5 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sat, 19 May 2001 01:30:02 +0000 Subject: [PATCH] (process-define-module): Do not call set-current-module. (define-module): Do it here, in the expansion. (top-repl): Do not define '(guile-user)' module and conditionally load `(ice-9 threads)' and/or `(ice-9 regex)' here. Do it on top-level as the last thing in boot-9.scm instead. (%load-path): Use `list' instead of `cons' to create a single element list when adding "." to it. (process-define-module, process-use-modules, module-export!): Add dummy definitions prior to booting the mdule system. --- ice-9/boot-9.scm | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm index 6ff5cf5ea..1eb6a7e76 100644 --- a/ice-9/boot-9.scm +++ b/ice-9/boot-9.scm @@ -1577,8 +1577,13 @@ ;; Get/create it. (make-modules-in (current-module) full-name)))))) -;; Cheat. +;; Cheat. These bindings are needed by modules.c, but we don't want +;; to move their real definition here because that would be unnatural. +;; (define try-module-autoload #f) +(define process-define-module #f) +(define process-use-modules #f) +(define module-export! #f) ;; This boots the module system. All bindings needed by modules.c ;; must have been defined by now. @@ -1724,7 +1729,6 @@ (append (cadr kws) exports))) (else (unrecognized kws)))))) - (set-current-module module) module)) ;;; {Autoload} @@ -2594,7 +2598,7 @@ (defmacro define-module args `(eval-case ((load-toplevel) - (process-define-module ',args)) + (set-current-module (process-define-module ',args))) (else (error "define-module can only be used at the top level")))) @@ -2817,18 +2821,6 @@ (module-ref the-root-module 'use-emacs-interface)) (load-emacs-interface)) - ;; Place the user in the guile-user module. - (process-define-module - '((guile-user) - :use-module (guile) ;so that bindings will be checked here first - :use-module (ice-9 session) - :use-module (ice-9 debug) - :autoload (ice-9 debugger) (debug))) ;load debugger on demand - (and (provided? 'threads) - (named-module-use! '(guile-user) '(ice-9 threads))) - (and (provided? 'regex) - (named-module-use! '(guile-user) '(ice-9 regex))) - (let ((old-handlers #f) (signals (if (provided? 'posix) `((,SIGINT . "User interrupt") @@ -2886,8 +2878,19 @@ (define exit-hook (make-hook)) -(define-module (guile)) +(append! %load-path (list ".")) -(append! %load-path (cons "." '())) +;; Place the user in the guile-user module. +;; +(define-module (guile-user) + :use-module (guile) ;so that bindings will be checked here first + :use-module (ice-9 session) + :use-module (ice-9 debug) + :autoload (ice-9 debugger) (debug)) ;load debugger on demand + +(if (provided? 'threads) + (use-modules (ice-9 threads))) +(if (provided? 'regex) + (use-modules (ice-9 regex))) ;;; boot-9.scm ends here