diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index 2a2e32fd8..8be502793 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,12 @@ +1998-07-14 Mikael Djurfeldt + + * boot-9.scm: Let the user start in module `(user)' instead of + module `(guile)'. Also make sure that `(user)' uses suitable + modules. This change improves Guile stability substantially since + bindings will only be copied from the root module: If the user + redefines builtins in `(user)' it won't affect the internal + operation of Guile itself. + 1998-06-19 Mikael Djurfeldt * boot-9.scm (load-module): When loading files from within files diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm index 158a4c582..5ea08f75a 100644 --- a/ice-9/boot-9.scm +++ b/ice-9/boot-9.scm @@ -2907,40 +2907,42 @@ `(catch #t (lambda () ,expr) (lambda args #f))) -;;; {Load debug extension code if debug extensions present.} -;;; -;;; *fixme* This is a temporary solution. -;;; - -(if (memq 'debug-extensions *features*) - (define-module (guile) :use-module (ice-9 debug))) - - -;;; {Load session support if present.} -;;; -;;; *fixme* This is a temporary solution. -;;; - -(if (%search-load-path "ice-9/session.scm") - (define-module (guile) :use-module (ice-9 session))) - -;;; Load readline code if readline primitives are available. +;;; Load readline code into root module if readline primitives are available. ;;; ;;; Ideally, we wouldn't do this until we were sure we were actually ;;; going to enter the repl, but autoloading individual functions is ;;; clumsy at the moment. (if (and (memq 'readline *features*) (isatty? (current-input-port))) - (define-module (guile) :use-module (ice-9 readline))) + (begin + (define-module (guile) :use-module (ice-9 readline)) + (define-module (user) :use-module (ice-9 readline)))) -;;; {Load thread code if threads are present.} +;;; {Load debug extension code into user module if debug extensions present.} +;;; +;;; *fixme* This is a temporary solution. +;;; + +(if (memq 'debug-extensions *features*) + (define-module (user) :use-module (ice-9 debug))) + + +;;; {Load session support into user module if present.} +;;; +;;; *fixme* This is a temporary solution. +;;; + +(if (%search-load-path "ice-9/session.scm") + (define-module (user) :use-module (ice-9 session))) + +;;; {Load thread code into user module if threads are present.} ;;; ;;; *fixme* This is a temporary solution. ;;; (if (memq 'threads *features*) - (define-module (guile) :use-module (ice-9 threads))) + (define-module (user) :use-module (ice-9 threads))) ;;; {Load emacs interface support if emacs option is given.} @@ -2953,15 +2955,17 @@ (begin (if (memq 'debug-extensions *features*) (debug-enable 'backtrace)) - (define-module (guile) :use-module (ice-9 emacs)))) + (define-module (user) :use-module (ice-9 emacs)))) ;;; {Load regexp code if regexp primitives are available.} (if (memq 'regex *features*) - (define-module (guile) :use-module (ice-9 regex))) + (define-module (user) :use-module (ice-9 regex))) +(define-module (guile)) + ;;; {Check that the interpreter and scheme code match up.} (let ((show-line @@ -2984,8 +2988,8 @@ (show-line "libguile: configured on " (libguile-config-stamp)) (show-line "ice-9: configured on " (ice-9-config-stamp))))) +(append! %load-path (cons "." ())) + -(define-module (guile)) - -(append! %load-path (cons "." ())) +(define-module (user))