[Armedbear-devel] wild-pathname-p inconsistent?

Pascal J. Bourguignon pjb at informatimago.com
Wed Sep 24 04:05:07 UTC 2014


Why do we have?

    (wild-pathname-p  #P"*-blah") -> T
    (wild-pathname-p  #P"*-blah" :name) -> NIL

This is inconsistent (and non-conforming). 
Actually wild-pathname-p returns NIL for all fields:

(mapcar (lambda (field) (wild-pathname-p  #P"*-blah" field))
        (list :host :device :directory :name :type :version))'
--> (NIL NIL NIL NIL NIL NIL)

If that was true, then (wild-pathname-p #P"*-blah" nil) should return
NIL, not true.


    If field-key is not supplied or nil, wild-pathname-p returns true if
    pathname has any wildcard components, nil if pathname has none. If
    field-key is non-nil, wild-pathname-p returns true if the indicated
    component of pathname is a wildcard, nil if the component is not a
    wildcard.

So we should have:

   (defun wild-pathname-p (path &optional field-key)
     (if (null field-key)
         (some (lambda (field-key)
                 (wild-pathname-p path field-key))
               '(:host :device :directory :name :type :version))
         …))



(This bug is found in 1.0.1 and 1.3.1).

[pjb at kuiper :0.0 languages]$ abcl --noinit
Armed Bear Common Lisp 1.3.1
Java 1.7.0_25 Oracle Corporation
OpenJDK 64-Bit Server VM
Low-level initialization completed in 0.326 seconds.
Startup completed in 2.088 seconds.
Type ":help" for a list of available commands.
CL-USER(1): (mapcar (lambda (field) (wild-pathname-p  #P"*-blah" field))
                    (list :host :device :directory :name :type :version nil))
(NIL NIL NIL NIL NIL NIL T)
CL-USER(2): (quit)
[pjb at kuiper :0.0 languages]$ 

-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk

_______________________________________________
Armedbear-devel mailing list
Armedbear-devel at common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel


More information about the armedbear-devel mailing list