summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2010-09-04 10:24:52 -0700
committerAndy Wingo <wingo@pobox.com>2010-09-04 10:28:46 -0700
commit76aea207c805dca8a0f086bbe8edd48e294aa46f (patch)
treef5cadd5400bf0d16faba4fb7ed497392b8d65a45
parent1d3aa2baaee0e1c2f7cc943107406241ea580c5f (diff)
downloadguile-76aea207c805dca8a0f086bbe8edd48e294aa46f.tar.gz
boot-9 refactor
* module/ice-9/boot-9.scm (make-root-module, make-scm-module): Remove these functions; they are only called once, so we inline them at their call sites. (the-root-module, the-scm-module): The aforementioned call sites.
-rw-r--r--module/ice-9/boot-9.scm66
1 files changed, 27 insertions, 39 deletions
diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index 1c242df93..3f00afb9f 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -1836,37 +1836,6 @@ If there is no handler at all, Guile prints an error and then exits."
-;;; {Low Level Bootstrapping}
-;;;
-
-;; make-root-module
-
-;; A root module uses the pre-modules-obarray as its obarray. This
-;; special obarray accumulates all bindings that have been established
-;; before the module system is fully booted.
-;;
-;; (The obarray continues to be used by code that has been closed over
-;; before the module system has been booted.)
-
-(define (make-root-module)
- (let ((m (make-module 0)))
- (set-module-obarray! m (%get-pre-modules-obarray))
- m))
-
-;; make-scm-module
-
-;; The root interface is a module that uses the same obarray as the
-;; root module. It does not allow new definitions, tho.
-
-(define (make-scm-module)
- (let ((m (make-module 0)))
- (set-module-obarray! m (%get-pre-modules-obarray))
- (set-module-eval-closure! m (standard-interface-eval-closure m))
- m))
-
-
-
-
;;; {Module-based Loading}
;;;
@@ -2131,15 +2100,34 @@ If there is no handler at all, Guile prints an error and then exits."
(define (set-system-module! m s)
(set-procedure-property! (module-eval-closure m) 'system-module s))
-(define the-root-module (make-root-module))
-(define the-scm-module (make-scm-module))
-(set-module-public-interface! the-root-module the-scm-module)
-(set-module-name! the-root-module '(guile))
-(set-module-name! the-scm-module '(guile))
-(set-module-kind! the-scm-module 'interface)
-(set-system-module! the-root-module #t)
-(set-system-module! the-scm-module #t)
+;; The root module uses the pre-modules-obarray as its obarray. This
+;; special obarray accumulates all bindings that have been established
+;; before the module system is fully booted.
+;;
+;; (The obarray continues to be used by code that has been closed over
+;; before the module system has been booted.)
+;;
+(define the-root-module
+ (let ((m (make-module 0)))
+ (set-module-obarray! m (%get-pre-modules-obarray))
+ (set-module-name! m '(guile))
+ (set-system-module! m #t)
+ m))
+
+;; The root interface is a module that uses the same obarray as the
+;; root module. It does not allow new definitions, tho.
+;;
+(define the-scm-module
+ (let ((m (make-module 0)))
+ (set-module-obarray! m (%get-pre-modules-obarray))
+ (set-module-eval-closure! m (standard-interface-eval-closure m))
+ (set-module-name! m '(guile))
+ (set-module-kind! m 'interface)
+ (set-system-module! m #t)
+ m))
+
+(set-module-public-interface! the-root-module the-scm-module)