aboutsummaryrefslogtreecommitdiff
path: root/src/lisp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-04-23 22:44:32 +0000
committerdos-reis <gdr@axiomatics.org>2008-04-23 22:44:32 +0000
commit695a6c656681918abe4b20e04470dd266b4f6bbe (patch)
treee5efcaefebf2d89118a8a00a9e11ba5547826fe3 /src/lisp
parentc3b3651a804ebbdf40b3b59490d62ac63e3bf233 (diff)
downloadopen-axiom-695a6c656681918abe4b20e04470dd266b4f6bbe.tar.gz
* boot/ast.boot: Tidy.
* boot/includer.boot: Likewise. * boot/parser.boot: Likewise. * boot/pile.boot: Likewise. * boot/scanner.boot: Likewise. * boot/tokens.boot: Likewise. * boot/translator.boot: Likewise. * boot/strap: Update Lisp translation. * lisp/core.lisp.in: Tidy.
Diffstat (limited to 'src/lisp')
-rw-r--r--src/lisp/core.lisp.in49
1 files changed, 31 insertions, 18 deletions
diff --git a/src/lisp/core.lisp.in b/src/lisp/core.lisp.in
index c6ba6cd3..aecca91e 100644
--- a/src/lisp/core.lisp.in
+++ b/src/lisp/core.lisp.in
@@ -192,6 +192,9 @@
(|installDriver| key driver)))
+;; true if in main program booted
+(defvar |$mainBooted| nil)
+
;;
;; -*- OpenAxiom Command Line Parsing -*-
;;
@@ -465,10 +468,13 @@
(|saveCore| core-image entry-point))
#+:ecl (progn
(unless entry-point
- (setq entry-point si::top-level))
+ (setq entry-point #'si::top-level))
(c:build-program core-image
- :lisp-files (mapcar #'|compileFilePathname| lisp-files)
- :epilogue-code `(,entry-point))
+ :lisp-files (mapcar #'|compileFilePathname|
+ lisp-files)
+ :epilogue-code `(progn
+ (setq |$mainBooted| t)
+ (,entry-point)))
(|coreQuit|)))
@@ -721,12 +727,17 @@
(defparameter |$ImportedModules| nil)
;; Return true if MODULE is known to have been imported or loaded.
+(defun |getModuleInternalSymbol| (module)
+ (intern module (find-package "AxiomCore")))
+
(defun |alreadyLoaded?| (module)
- (member (namestring module) |$ImportedModules| :test #'equal))
+ (get (|getModuleInternalSymbol| (namestring module))
+ '|AxiomCore.loaded|))
-;; Remember that MODULE is imported or loaded.
-(defun |noteLoadUnit| (module)
- (pushnew (namestring module) |$ImportedModules|))
+;; Remember that MODULE was imported or loaded.
+(defun |noteUnitLoaded| (module)
+ (setf (get (|getModuleInternalSymbol| (namestring module))
+ '|AxiomCore.loaded|) t))
;; We are searching for MODULE (currently a FASL) in DIRECTORY. So, this
;; function returns a (tentative) pathname designating that module.
@@ -740,26 +751,28 @@
(if (|alreadyLoaded?| module)
module
(when (load module :if-does-not-exist nil)
- (|noteLoadUnit| module)
+ (|noteUnitLoaded| module)
module)))
(defun |loadOrElse| (module)
(if (|alreadyLoaded?| module)
module
(when (load module :if-does-not-exist :error)
- (|noteLoadUnit| module)
+ (|noteUnitLoaded| module)
module)))
(defun do-import-module (module directories)
- (unless directories
- (|fatalError|
- (format nil
- "module ~S not found in search path ~S"
- module
- |$LoadDirectories|)))
- (let ((p (|loadPathname| module (car directories))))
- (unless (|loadIfPresent| p)
- (do-import-module module (cdr directories)))))
+ (cond ((null directories)
+ (unless (and (member :ecl *features* :test #'eq) |$mainBooted|)
+ (|fatalError|
+ (format nil
+ "module ~S not found in search path ~S"
+ module
+ |$LoadDirectories|))))
+ (t
+ (let ((p (|loadPathname| module (car directories))))
+ (unless (|loadIfPresent| p)
+ (do-import-module module (cdr directories)))))))
(defun |importModule| (module)
(do-import-module module |$LoadDirectories|))