(process-define-module): Do not call
authorMarius Vollmer <mvo@zagadka.de>
Sat, 19 May 2001 01:30:02 +0000 (01:30 +0000)
committerMarius Vollmer <mvo@zagadka.de>
Sat, 19 May 2001 01:30:02 +0000 (01:30 +0000)
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

index 6ff5cf5..1eb6a7e 100644 (file)
            ;; 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.
                     (append (cadr kws) exports)))
              (else
                (unrecognized kws))))))
-    (set-current-module module)
     module))
 
 ;;; {Autoload}
 (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"))))
 
           (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")
 (define exit-hook (make-hook))
 
 \f
-(define-module (guile))
+(append! %load-path (list "."))
+
+;; 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
 
-(append! %load-path (cons "." '()))
+(if (provided? 'threads)
+    (use-modules (ice-9 threads)))
+(if (provided? 'regex)
+    (use-modules (ice-9 regex)))
 
 ;;; boot-9.scm ends here