Load behaviour on Maxima 5.18.0 and above using ecl
Subject: Load behaviour on Maxima 5.18.0 and above using ecl
From: Raymond Toy
Date: Wed, 20 May 2009 09:43:16 -0400
Matthew Gwynne wrote:
> On Mon, May 18, 2009 at 5:23 PM, Raymond Toy <raymond.toy at stericsson.com> wrote:
>
>> Matthew Gwynne wrote:
>>
>>> (%i1) :lisp *autoconf-win32*
>>>
>>> false
>>>
>>>
>>>
>> Ok. This all works for me with ecl 8.12. What version of ecl? 9.4.1?
>>
>
> Yep, 9.4.1 .
>
>
>> To debug this, take a look at share-subdirs-list in init-cl.lisp. I'll
>> need to see some of the values of the variables in that function. What
>> is the value of dir-list, after getting the directory list? Perhaps the
>> bug is in enough-namestring?
>>
>
>
> with the following code in "init-cl.lisp":
>
> #+(or clisp ecl)
> (defun share-subdirs-list ()
> ;; This doesn't work yet on windows. Give up in that case and use
> ;; the default list.
> (print "CLISP/ECL\n")
> (if (string= *autoconf-win32* "true")
> (default-share-subdirs-list)
> (let* ((share-root (pathname (concatenate 'string
> *maxima-sharedir* "/")))
> (dir-list (directory (merge-pathnames (make-pathname
> :directory '(:relative :wild-inferiors))
> share-root))))
> ;; dir-list contains all of the directories. Remove stuff we
> ;; don't want like CVS directories. Anything else?
> (setf dir-list (delete-if #'(lambda (x)
> ;; Remove CVS directories
> (or (equal x share-root)
> (equal "CVS" (car (last (pathname-directory x))))))
> dir-list))
> ;; Now just want the part after the *maxima-sharedir*, and we want
> ;; strings.
> (setf dir-list
> (mapcar #'(lambda (x)
> (let ((dir (make-pathname :directory (butlast
> (pathname-directory x))
> :name (car (last (pathname-directory x))))))
> (enough-namestring dir share-root)))
> dir-list))
> (print "Dir-List = ")
> (mapcar #'print dir-list)
> ;; Sort in alphabetical order
> (sort dir-list #'string-lessp))))
>
That wasn't particularly helpful because we already knew it was wrong.
But I wasn't very clear either, so I take full blame for that. :-)
Can you try the following replacement? (Stick it in some new file, and
load it into maxima and run it.) I don't need everything that is
printed out, just the first few lines to see if enough-namestring is
doing what we want.
Thanks!
Ray
(in-package :maxima)
(defun share-subdirs-list ()
;; This doesn't work yet on windows. Give up in that case and use
;; the default list.
(if (string= *autoconf-win32* "true")
(default-share-subdirs-list)
(let* ((share-root (pathname (concatenate 'string
*maxima-sharedir* "/")))
(dir-list (directory (merge-pathnames (make-pathname :directory
'(:relative :wild-inferiors))
share-root))))
;; dir-list contains all of the directories. Remove stuff we
;; don't want like CVS directories. Anything else?
(setf dir-list (delete-if #'(lambda (x)
;; Remove CVS directories
(or (equal x share-root)
(equal "CVS" (car (last (pathname-directory x))))))
dir-list))
;; Now just want the part after the *maxima-sharedir*, and we want
;; strings.
(format t "share-root = ~A~%" share-root)
(setf dir-list
(mapcar #'(lambda (x)
(let ((dir (make-pathname :directory (butlast
(pathname-directory x))
:name (car (last (pathname-directory x))))))
(format t "x = ~A~%" x)
(format t "dir = ~A~%" dir)
(format t "enough = ~A~%" (enough-namestring dir
share-root))
(enough-namestring dir share-root)))
dir-list))
;; Sort in alphabetical order
(sort dir-list #'string-lessp))))