1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-05 15:10:27 +02:00

* 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.
This commit is contained in:
Mikael Djurfeldt 1998-07-14 10:23:40 +00:00
parent 94277faf56
commit 13e341bb4d
2 changed files with 39 additions and 26 deletions

View file

@ -1,3 +1,12 @@
1998-07-14 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
* 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 <mdj@barbara.nada.kth.se> 1998-06-19 Mikael Djurfeldt <mdj@barbara.nada.kth.se>
* boot-9.scm (load-module): When loading files from within files * boot-9.scm (load-module): When loading files from within files

View file

@ -2907,40 +2907,42 @@
`(catch #t (lambda () ,expr) `(catch #t (lambda () ,expr)
(lambda args #f))) (lambda args #f)))
;;; {Load debug extension code if debug extensions present.} ;;; Load readline code into root module if readline primitives are available.
;;;
;;; *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.
;;; ;;;
;;; Ideally, we wouldn't do this until we were sure we were actually ;;; Ideally, we wouldn't do this until we were sure we were actually
;;; going to enter the repl, but autoloading individual functions is ;;; going to enter the repl, but autoloading individual functions is
;;; clumsy at the moment. ;;; clumsy at the moment.
(if (and (memq 'readline *features*) (if (and (memq 'readline *features*)
(isatty? (current-input-port))) (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. ;;; *fixme* This is a temporary solution.
;;; ;;;
(if (memq 'threads *features*) (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.} ;;; {Load emacs interface support if emacs option is given.}
@ -2953,15 +2955,17 @@
(begin (begin
(if (memq 'debug-extensions *features*) (if (memq 'debug-extensions *features*)
(debug-enable 'backtrace)) (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.} ;;; {Load regexp code if regexp primitives are available.}
(if (memq 'regex *features*) (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.} ;;; {Check that the interpreter and scheme code match up.}
(let ((show-line (let ((show-line
@ -2984,8 +2988,8 @@
(show-line "libguile: configured on " (libguile-config-stamp)) (show-line "libguile: configured on " (libguile-config-stamp))
(show-line "ice-9: configured on " (ice-9-config-stamp))))) (show-line "ice-9: configured on " (ice-9-config-stamp)))))
(append! %load-path (cons "." ()))
(define-module (guile)) (define-module (user))
(append! %load-path (cons "." ()))