1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 09:10:22 +02:00

(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.
This commit is contained in:
Marius Vollmer 2001-05-19 01:30:02 +00:00
parent 21a13beb20
commit d866f4455b

View file

@ -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