This change is required by Allegro CL.

For a string STR1 (such as "INT"), (directory-namestring STR1)
returns "" for other Lisps, but Allegro returns "./".

Anyway, for the use case in daase.lisp, "pathname-directory"
is more appropriate: it returns nil if the argument contains
no directory part.

The other usage of "directory-namestring" in daase is fine,
because the argument is valid path.

- Qian

diff --git a/src/interp/daase.lisp b/src/interp/daase.lisp
index 97d50a8c..87213a72 100644
--- a/src/interp/daase.lisp
+++ b/src/interp/daase.lisp
@@ -488,7 +488,7 @@ database.
 ; system files is only the filename and extension. for user files it
 ; contains the full pathname. when the database is first opened the
 ; sourcefile slot contains system names. the lookup function
-; has to prefix the |$spadroot| information if the directory-namestring is
+; has to prefix the |$spadroot| information if the pathname-directory is
 ; null (we don't know the real root at database build time).
 ; a object-hash table is set up to look up nrlib and ao information.
 ; this slot is empty until a user does a )library call. we remember
@@ -790,7 +790,7 @@ database.
     (sourcefile          (setf (|database-sourcefile| struct) data))))
    (case key ; fixup the special cases
     (sourcefile
-     (when (and data (string= (directory-namestring data) "")
+     (when (and data (null (pathname-directory data))
              (string= (pathname-type data) "spad"))
       (setq data
        (concatenate 'string |$spadroot| "/../../src/algebra/" data))))
@@ -801,11 +801,11 @@ database.
     (object                                ; fix up system object pathname
      (if (consp data)
        (setq data
-             (if (string= (directory-namestring (car data)) "")
+             (if (null (pathname-directory (car data)))
                  (concatenate 'string |$spadroot| "/algebra/" (car data)
                                         "." |$lisp_bin_filetype|)
                (car data)))
-      (when (and data (string= (directory-namestring data) ""))
+      (when (and data (null (pathname-directory data)))
        (setq data (concatenate 'string |$spadroot| "/algebra/" data
                                           "." |$lisp_bin_filetype|)))))))
   data))

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/1f3079fc-de30-4977-b679-9fc3f7ebe0a0%40gmail.com.

Reply via email to