bugGNU Common Lisp - Bugs: bug #7935, Pathname keywords for 2.7.x

 
 

bug #7935: Pathname keywords for 2.7.x

Submitted by:  Mike Thomas <mjthomas>
Submitted on:  Sat 28 Feb 2004 12:22:20 AM UTC  
 
Category: NoneSeverity: 1 - Wish
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 28 Feb 2004 12:22:20 AM UTC, original submission:

Greetings, and thanks for this! OK, this is a straightforward change
in keyword names from what we have now. I'll put this on the list for
early 2.7.x. Please don't let me forget.

Take care,

Dennis Decker Jensen <> writes:

> Hi Camm
>
> Sorry for putting up new thread, but I deleted your mail by
> mistake.
>
> I've been playing with pathnames in CLisp and SBCL to find out
> more from other actual implementations, and there are notable
> differences in how it can be done.
>
> I will not go into too much details. The most significant
> difference to GCL's old (CLTL2?) implementation is in the
> pathname-directory component of a pathname.
>
> In ANSI the directory component (a list) must start with either
> the symbol RELATIVE or the symbol ABSOLUTE. From there only
> strings and the symbols UP or BACK are allowed. The difference
> between the latter and the former is a matter of syntactic or
> semantic behaviour.
>
> How the namestrings are constructed depends upon the
> implementation. SBCL don't accept BACK at the moment when
> constructing namestrings, while CLisp has both UP and BACK
> taking semantic behaviour. SBCL does't touch it's pathnames,
> while CLisp does at creation time as you can see below in the
> examples.
>
> GCL currently uses symbols as well as strings with the special
> symbols ROOT, CURRENT and PARENT which has special meanings.
> I gather this is the CLTL2 way. None of this is ANSI anyway.
>
> There are further constraints on some of the other components,
> but I don't think it is all needed at once judged by the other
> implementations and the diversity among them.
>
> Examples:
>
> <<<CLisp>>>
>
> ;; Dribble of #<IO TERMINAL-STREAM> started 2004-02-27 14:07:39
> #<OUTPUT BUFFERED FILE-STREAM CHARACTER #P"clisp.pathnames">
> [2]> (make-pathname :directory '(:relative "a" "b" "c"))
> #P"a/b/c/"
> [3]> (make-pathname :directory '(:absolute "a" "b" "c"))
> #P"/a/b/c/"
> [4]> (make-pathname :directory '(:absolute "a" "b" :up "c"))
> #P"/a/c/"
> [5]> (make-pathname :directory '(:absolute "a" "b" :back "c"))
> #P"/a/c/"
> [6]> (pathname-directory (make-pathname :directory '(:absolute "a" "b" :back "c")))
> (:ABSOLUTE "a" "c")
> [7]> (pathname-directory #P"/a/b/../c/")
> (:ABSOLUTE "a" "c")
> [8]> (pathname-directory #P"/a/b/c/")
> (:ABSOLUTE "a" "b" "c")
> [9]> (pathname-directory #P"/a/b/c")
> (:ABSOLUTE "a" "b")
> [10]> (dribble)
> ;; Dribble of #<IO TERMINAL-STREAM> finished 2004-02-27 14:10:07
>
> ;; Dribble of #<IO TERMINAL-STREAM> started 2004-02-27 14:28:08
> #<OUTPUT BUFFERED FILE-STREAM CHARACTER #P"clisp.pathnames">
> [2]> (make-pathname :directory '("a" "b" "c"))
>
> *** - MAKE-PATHNAME: illegal :DIRECTORY argument ("a" "b" "c")
> Break 1 [3]> :q
>
> [4]> (make-pathname :directory '(:relative "a" "b" "c"))
> #P"a/b/c/"
> [5]> (make-pathname :directory '(:relative "a" "b" :parent "c"))
>
> *** - MAKE-PATHNAME: illegal :DIRECTORY argument (:RELATIVE "a" "b" :PARENT "c")
> Break 1 [6]> :q
>
> [7]> (make-pathname :directory '(:relative "a" "b" :current "c"))
>
> *** - MAKE-PATHNAME: illegal :DIRECTORY argument (:RELATIVE "a" "b" :CURRENT "c")
> Break 1 [8]> :q
>
> [9]> (dribble)
> ;; Dribble of #<IO TERMINAL-STREAM> finished 2004-02-27 14:29:01
>
>
> <<<SBCL>>>
> * (make-pathname :directory '(:relative "a" "b" "c"))
>
> #P"a/b/c/"
> * (make-pathname :directory '(:absolute "a" "b" "c"))
>
> #P"/a/b/c/"
> * (make-pathname :directory '(:absolute "a" "b" :up "c"))
>
> #P"/a/b/../c/"
> * (make-pathname :directory '(:absolute "a" "b" :back "c"))
>
> #<PATHNAME
> (with no namestring)
> :HOST #<SB-IMPL::UNIX-HOST {505D1B9}>
> :DEVICE NIL
> :DIRECTORY (:ABSOLUTE "a" "b" :BACK "c")
> :NAME NIL
> :TYPE NIL
> :VERSION NIL>
> * (pathname-directory (make-pathname :directory '(:absolute "a" "b" :up "c")))
>
> (:ABSOLUTE "a" "b" :UP "c")
> * (pathname-directory #P"/a/b/../c/")
>
> (:ABSOLUTE "a" "b" :UP "c")
> * (pathname-directory #P"/a/b/c/")
>
> (:ABSOLUTE "a" "b" "c")
> * (pathname-directory #P"/a/b/c")
>
> (:ABSOLUTE "a" "b")
> * (pathname-directory #P"a/b/c/")
>
> (:RELATIVE "a" "b" "c")
> * (pathname-directory #P"../../")
>
> (:RELATIVE :UP :UP)
> * (pathname-directory (parse-namestring "/a/b/../c/"))
>
> (:ABSOLUTE "a" "b" :UP "c")
>
> * (make-pathname :directory '("a" "b" "c"))
>
> #<PATHNAME
> (with no namestring)
> :HOST #<SB-IMPL::UNIX-HOST {505D1B9}>
> :DEVICE NIL
> :DIRECTORY ("a" "b" "c")
> :NAME NIL
> :TYPE NIL
> :VERSION NIL>
> * (make-pathname :directory '(:relative "a" "b" "c"))
>
> #P"a/b/c/"
> * (make-pathname :directory '(:relative "a" "b" :parent "c"))
>
> debugger invoked on a SIMPLE-ERROR in thread 31541:
> :PARENT is not allowed as a directory component.
>
> * (make-pathname :directory '(:relative "a" "b" :current "c"))
>
> debugger invoked on a SIMPLE-ERROR in thread 31541:
> :CURRENT is not allowed as a directory component.
>
> >>>
>
> I haven't looked at logical pathnames which is whole topic
> itself.
>
> Hope it made things a little clearer.
>
> --
> Dennis Decker Jensen
>
>
>

===============
"The earth is but one country, and mankind its citizens." -- Baha'u'llah

Mike Thomas <mjthomas>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 09 Jul 2008 07:25:20 AM UTCNoneAttached File-=>Added get_mysql_80x15_2.png, #16060
Sat 28 Feb 2004 12:22:20 AM UTCmjthomasCarbon-Copy-=>Added ddj --AT-- gyxi --DOT-- dk

Back to the top


Powered by Savane 3.1-cleanup