aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-03-10 05:21:00 +0000
committerdos-reis <gdr@axiomatics.org>2008-03-10 05:21:00 +0000
commit6cd03930cf6d06aeb22d8a03f88e21aed3741846 (patch)
tree9afeca88d3d16cad78167df6e8936c0a70724b4c /src/interp
parent6134f0731a2f170fd76b08b435f7a813ee74b806 (diff)
downloadopen-axiom-6cd03930cf6d06aeb22d8a03f88e21aed3741846.tar.gz
* lisp/core.lisp.in ("$faslType"): Export.
* interp/sys-driver.boot (algebraBootstrapDir): New. * interp/lisplib.boot (findModule): New. (loadLib): Use it. * interp/daase.lisp (localdatabase): Make sure loadable modules have proper extensions. * interp/sys-utility.boot (existingFile?): New.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/daase.lisp3
-rw-r--r--src/interp/lisplib.boot17
-rw-r--r--src/interp/sys-driver.boot7
-rw-r--r--src/interp/sys-utility.boot4
4 files changed, 25 insertions, 6 deletions
diff --git a/src/interp/daase.lisp b/src/interp/daase.lisp
index ea9bebd3..00525246 100644
--- a/src/interp/daase.lisp
+++ b/src/interp/daase.lisp
@@ -924,7 +924,8 @@
(dolist (file libs) (|addInputLibrary| (truename file)))
(dolist (file (nreverse nrlibs))
(setq key (pathname-name (first (last (pathname-directory file)))))
- (setq object (concatenate 'string (directory-namestring file) "code"))
+ (setq object (concatenate 'string (directory-namestring file)
+ "code." |$faslType|))
(localnrlib key file object make-database? noexpose))
(dolist (file (nreverse asys))
(setq object
diff --git a/src/interp/lisplib.boot b/src/interp/lisplib.boot
index f111df8f..cd3b728d 100644
--- a/src/interp/lisplib.boot
+++ b/src/interp/lisplib.boot
@@ -127,6 +127,18 @@ isNestedInstantiation(form,deps) ==
false
--% Loading
+
+++ Return a path to the loadable module that contains the
+++ definition of the constructor indicated by `cname'.
+++ Error if the file container of the module does not exist.
+findModule cname ==
+ m := GETDATABASE(cname,'OBJECT) or return nil
+ existingFile? m => m
+ strap := algebraBootstrapDir() =>
+ m := CONCAT(strap,PATHNAME_-NAME m,'".",$faslType)
+ existingFile? m => m
+ systemError ['"missing module for ",:bright cname]
+ systemError ['"missing module for ",:bright cname]
loadLibIfNotLoaded libName ==
-- replaces old SpadCondLoad
@@ -137,7 +149,7 @@ loadLibIfNotLoaded libName ==
loadLib cname ==
startTimingProcess 'load
- fullLibName := GETDATABASE(cname,'OBJECT) or return nil
+ fullLibName := findModule cname or return nil
systemdir? := isSystemDirectory(pathnameDirectory fullLibName)
update? := $forceDatabaseUpdate or not systemdir?
not update? =>
@@ -691,6 +703,3 @@ isFunctor x ==
else updateCategoryFrameForConstructor op
get(op,'isFunctor,$CategoryFrame)
nil
-
-
-
diff --git a/src/interp/sys-driver.boot b/src/interp/sys-driver.boot
index 9b35d618..35681028 100644
--- a/src/interp/sys-driver.boot
+++ b/src/interp/sys-driver.boot
@@ -78,7 +78,6 @@ systemRootDirectory() ==
ensureTrailingSlash cdr dir
$systemInstallationDirectory
-
+++ Returns the system algebra directory, as specified on command
+++ line. nil, otherwise.
systemAlgebraDirectory() ==
@@ -86,6 +85,12 @@ systemAlgebraDirectory() ==
ensureTrailingSlash cdr dir
nil
++++ Returns a path to the directory containing algebra bootstsrap files.
+algebraBootstrapDir() ==
+ dir := ASSOC(Option '"strap",%systemOptions()) =>
+ ensureTrailingSlash rest dir
+ nil
+
++ stdStreamIsTerminal:
++ returns 1 if the standard stream is attached to a terminal;
++ otherwise 0.
diff --git a/src/interp/sys-utility.boot b/src/interp/sys-utility.boot
index faf4708d..2e8502dd 100644
--- a/src/interp/sys-utility.boot
+++ b/src/interp/sys-utility.boot
@@ -132,3 +132,7 @@ makeAbsoluteFilename: %String -> %String
makeAbsoluteFilename name ==
CONCATENATE("STRING",systemRootDirectory(),name)
+++ returns true if `file' exists as a pathname.
+existingFile? file ==
+ PROBE_-FILE file
+