[cl-ppcre-devel] Problem with pathnames

5 views
Skip to first unread message

Juan Jose Garcia-Ripoll

unread,
Jan 12, 2011, 10:16:02 AM1/12/11
to General interest list about cl-ppcre and cl-unicode, list-ecl
[I CC just in case the ECL mailing list provides me a better answer]

In polishing the upcoming ECL release I discovered that there are two problems when trying to compile cl-unicode. One is due to a bug in ECL, the other one is due to what I believe an error in CL-UNICODE. More precisely, in build/dump.lisp I find

  (with-output-to-source-file (out (make-pathname :name "derived-properties"
                                                  :type :unspecific
                                                  :directory '(:relative :up "test"))
                                   :no-header-p t)

As far as I know, :UNSPECIFIC is reserved for values that do not make sense for a filesystem, but in this particular case what happens is that the file does not have a file extension, not that extensions (types) do not exist at all.

The consequence is that this lisp form creates an unprintable pathname (one which cannot be written "readably"), both in ECL and CLISP, and ECL righteously complains that this file can not be opened.

I believe the appropriate line should be ":type nil", which works on SBCL, CLISP and ECL, AFAIK.

Am I wrong?

Juanjo

P.S.: This is cl-unicode 0.1.1 distributed by quicklisp.

--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com

Edi Weitz

unread,
Jan 12, 2011, 10:39:56 AM1/12/11
to General interest list about cl-ppcre and cl-unicode
I made the change you proposed (see BKNR repository) but then
immediately reverted it again. The problem is that the pathname is
only created so that it will be merged afterwards (see
with-output-to-source-file). If you use NIL for the type slot, you
leave it "open" for MERGE-PATHNAMES to fill which is not what I want.
After reading the spec I agree with you, though, that :UNSPECIFIC
doesn't look right. Do you have a better idea how to solve this?

Thanks,
Edi.

> _______________________________________________
> cl-ppcre-devel site list
> cl-ppcr...@common-lisp.net
> http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
>

_______________________________________________
cl-ppcre-devel site list
cl-ppcr...@common-lisp.net
http://common-lisp.net/mailman/listinfo/cl-ppcre-devel

Juan Jose Garcia-Ripoll

unread,
Jan 12, 2011, 4:28:17 PM1/12/11
to General interest list about cl-ppcre and cl-unicode
I will look at the code and see how it is used. I thought it was directly passed to open but now I see that the with-... macro is not a standard one. What about merging in a way that does not pass the extensions? What about

(merge-pathnames ,relative-path (make-pathname :name nil :type nil *this-file*))

instead of

(merge-pathnames ,relative-path *this-file*)

Juanjo

Juan Jose Garcia-Ripoll

unread,
Jan 12, 2011, 4:39:14 PM1/12/11
to General interest list about cl-ppcre and cl-unicode, list-ecl
This patch seems to fix everything and let cl-unicode build with ECL

--- dump-orig.lisp 2011-01-12 22:37:54.000000000 +0100
+++ dump.lisp 2011-01-12 22:32:17.000000000 +0100
@@ -105,7 +105,8 @@
 writes to the file denoted by RELATIVE-PATH - a path relative to the
 location of this source file.  Writes a Lisp header to the files
 unless NO-HEADER-P is true."
-  `(let ((pathname (merge-pathnames ,relative-path *this-file*)))
+  `(let ((pathname (merge-pathnames ,relative-path
+                                    (make-pathname :name nil :type nil *this-file*))))
      (format t "~&;;; Writing source file ~A" (file-namestring pathname))
      (force-output)
      (with-open-file (,stream pathname

Edi Weitz

unread,
Jan 12, 2011, 5:41:54 PM1/12/11
to General interest list about cl-ppcre and cl-unicode
I'm surprised that it works for your because there's a keyword missing
in the call to make-pathname. But the general idea is of course
correct and I've committed this to the BKNR repository now.

Thanks,
Edi.

Juan Jose Garcia-Ripoll

unread,
Jan 12, 2011, 6:02:30 PM1/12/11
to General interest list about cl-ppcre and cl-unicode
On Wed, Jan 12, 2011 at 11:41 PM, Edi Weitz <e...@weitz.de> wrote:
I'm surprised that it works for your because there's a keyword missing
in the call to make-pathname.  But the general idea is of course
correct and I've committed this to the BKNR repository now.

Probably because I had to rewrite the patch by hand after messing it up with emacs :-) Thanks for accepting the fix

Juanjo
Reply all
Reply to author
Forward
0 new messages