uiop parse-native-namestring portability?

Jared C. Davis jared.c.davis at gmail.com
Thu Jan 7 16:58:09 UTC 2016


Hi,

Ah, I should have though to include the components instead of the #P format.
Here's what I get on the various Lisps for:

   (defun show (x)
     (list :host (pathname-host x)
        :device (pathname-device x)
        :directory (pathname-directory x)
        :name (pathname-name x)
        :type (pathname-type x)
        :version (pathname-version x)))

   (show (uiop:parse-native-namestring "."))

Cheers,
Jared

CCL:   (:HOST :UNSPECIFIC
        :DEVICE NIL
        :DIRECTORY NIL
        :NAME NIL
        :TYPE ""
        :VERSION NIL)

SBCL:  (:HOST #<SB-IMPL::UNIX-HOST {1000F38E53}>
        :DEVICE NIL
        :DIRECTORY (:RELATIVE)
        :NAME "."
        :TYPE NIL
        :VERSION NIL)

Allegro: (:HOST NIL
          :DEVICE :UNSPECIFIC
          :DIRECTORY (:RELATIVE)
          :NAME NIL
          :TYPE NIL
          :VERSION :UNSPECIFIC)

CMUCL:  (:HOST ""
         :DEVICE NIL
         :DIRECTORY NIL
         :NAME "."
         :TYPE :UNSPECIFIC
         :VERSION NIL)

On Thu, Jan 7, 2016 at 10:43 AM, Raymond Toy <toy.raymond at gmail.com> wrote:
>>>>>> "Jared" == Jared C Davis <jared.c.davis at gmail.com> writes:
>
>     Jared> Hi,
>     Jared> Should I be able to expect the following to behave consistently across Lisps?
>
>     Jared> (file-namestring (uiop:parse-native-namestring "."))
>
>     Jared> I find that:
>
>     Jared> - CCL and SBCL produce "."
>     Jared> - Allegro produces NIL
>     Jared> - CMUCL signals an error in LISP::UNPARSE-UNIX-FILE
>
>     Jared> If I just look at:
>
>     Jared> (uiop:parse-native-namestring ".")
>
>     Jared> I get:
>
>     Jared> Allegro:  #P"./"
>     Jared> CCL:      #P"."
>     Jared> SBCL:     #P"."
>     Jared> CMUCL:    #P(:NAME "." :TYPE :UNSPECIFIC)
>
> I wonder why uiop:parse-native-namestring does that on cmucl.
> (cl:parse-namestring ".") returns #p"./", which, I think, makes sense.
>
> Without examining the actual slots, it's hard to tell what #p"."
> really is.
>
> --
> Ray
>
>



-- 
Jared C. Davis <jared at cs.utexas.edu>
11410 Windermere Meadows
Austin, TX 78759
http://www.cs.utexas.edu/users/jared/



More information about the asdf-devel mailing list