guile-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guile/guile-core/ice-9 boot-9.scm


From: Marius Vollmer
Subject: guile/guile-core/ice-9 boot-9.scm
Date: Fri, 01 Jun 2001 07:01:27 -0700

CVSROOT:        /cvs
Module name:    guile
Changes by:     Marius Vollmer <address@hidden> 01/06/01 07:01:27

Modified files:
        guile-core/ice-9: boot-9.scm 

Log message:
        (top-repl): Revert part of the 2001-05-19 change.
        When defining the guile-user module, do not use any modules.  Add
        them to guile-user when `top-repl' is called.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/ice-9/boot-9.scm.diff?cvsroot=OldCVS&tr1=1.254&tr2=1.255&r1=text&r2=text

Patches:
Index: guile/guile-core/ice-9/boot-9.scm
diff -u guile/guile-core/ice-9/boot-9.scm:1.254 
guile/guile-core/ice-9/boot-9.scm:1.255
--- guile/guile-core/ice-9/boot-9.scm:1.254     Fri May 25 06:18:52 2001
+++ guile/guile-core/ice-9/boot-9.scm   Fri Jun  1 07:01:27 2001
@@ -2838,59 +2838,77 @@
       (lambda (v) (fluid-set! using-readline? v)))))
 
 (define (top-repl)
+  (let ((guile-user-module (resolve-module '(guile-user))))
 
-  ;; Load emacs interface support if emacs option is given.
-  (if (and (module-defined? the-root-module 'use-emacs-interface)
-          (module-ref the-root-module 'use-emacs-interface))
-      (load-emacs-interface))
-
-  (let ((old-handlers #f)
-       (signals (if (provided? 'posix)
-                    `((,SIGINT . "User interrupt")
-                      (,SIGFPE . "Arithmetic error")
-                      (,SIGBUS . "Bad memory access (bus error)")
-                      (,SIGSEGV .
-                                "Bad memory access (Segmentation violation)"))
-                    '())))
-
-    (dynamic-wind
-
-     ;; call at entry
-     (lambda ()
-       (let ((make-handler (lambda (msg)
-                            (lambda (sig)
-                              ;; Make a backup copy of the stack
-                              (fluid-set! before-signal-stack
-                                          (fluid-ref the-last-stack))
-                              (save-stack %deliver-signals)
-                              (scm-error 'signal
-                                         #f
-                                         msg
-                                         #f
-                                         (list sig))))))
-        (set! old-handlers
-              (map (lambda (sig-msg)
-                     (sigaction (car sig-msg)
-                                (make-handler (cdr sig-msg))))
-                   signals))))
-
-     ;; the protected thunk.
-     (lambda ()
-       (let ((status (scm-style-repl)))
-        (run-hook exit-hook)
-        status))
-
-     ;; call at exit.
-     (lambda ()
-       (map (lambda (sig-msg old-handler)
-             (if (not (car old-handler))
-                 ;; restore original C handler.
-                 (sigaction (car sig-msg) #f)
-                 ;; restore Scheme handler, SIG_IGN or SIG_DFL.
-                 (sigaction (car sig-msg)
-                            (car old-handler)
-                            (cdr old-handler))))
-           signals old-handlers)))))
+    ;; Load emacs interface support if emacs option is given.
+    (if (and (module-defined? the-root-module 'use-emacs-interface)
+            (module-ref the-root-module 'use-emacs-interface))
+       (load-emacs-interface))
+
+    ;; Use some convenient modules (in reverse order)
+    
+    (if (provided? 'regex)
+       (module-use! guile-user-module (resolve-module '(ice-9 regex))))
+    (if (provided? 'threads)
+       (module-use! guile-user-module (resolve-module '(ice-9 threads))))
+    ;; load debugger on demand
+    (module-use! guile-user-module 
+                (make-autoload-interface guile-user-module
+                                         '(ice-9 debugger) '(debug)))
+    (module-use! guile-user-module (resolve-module '(ice-9 session)))
+    (module-use! guile-user-module (resolve-module '(ice-9 debug)))
+    ;; so that builtin bindings will be checked first
+    (module-use! guile-user-module (resolve-module '(guile))) 
+
+    (set-current-module guile-user-module)
+
+    (let ((old-handlers #f)
+         (signals (if (provided? 'posix)
+                      `((,SIGINT . "User interrupt")
+                        (,SIGFPE . "Arithmetic error")
+                        (,SIGBUS . "Bad memory access (bus error)")
+                        (,SIGSEGV
+                         . "Bad memory access (Segmentation violation)"))
+                      '())))
+
+      (dynamic-wind
+
+         ;; call at entry
+         (lambda ()
+           (let ((make-handler (lambda (msg)
+                                 (lambda (sig)
+                                   ;; Make a backup copy of the stack
+                                   (fluid-set! before-signal-stack
+                                               (fluid-ref the-last-stack))
+                                   (save-stack %deliver-signals)
+                                   (scm-error 'signal
+                                              #f
+                                              msg
+                                              #f
+                                              (list sig))))))
+             (set! old-handlers
+                   (map (lambda (sig-msg)
+                          (sigaction (car sig-msg)
+                                     (make-handler (cdr sig-msg))))
+                        signals))))
+         
+         ;; the protected thunk.
+         (lambda ()
+           (let ((status (scm-style-repl)))
+             (run-hook exit-hook)
+             status))
+         
+         ;; call at exit.
+         (lambda ()
+           (map (lambda (sig-msg old-handler)
+                  (if (not (car old-handler))
+                      ;; restore original C handler.
+                      (sigaction (car sig-msg) #f)
+                      ;; restore Scheme handler, SIG_IGN or SIG_DFL.
+                      (sigaction (car sig-msg)
+                                 (car old-handler)
+                                 (cdr old-handler))))
+                signals old-handlers))))))
 
 (defmacro false-if-exception (expr)
   `(catch #t (lambda () ,expr)
@@ -2905,15 +2923,6 @@
 
 ;; 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)))
+(define-module (guile-user))
 
 ;;; boot-9.scm ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]