Scieneer Common Lisp 1.3.9 online documentation

make-pathname &key scheme scheme-specific-part host device port username password directory name type version parameters query fragment defaults case class[Function]

Make a new pathname from the component arguments, and then merge in any unsupplied components from the defaults using the merging rules of merge-pathnames.

The class of the new pathname is either: the specified class, or logical-pathname if a defined logical pathname host is supplied or defaulted, or the result ext:scheme-pathname-class if a scheme is supplied or defaulted, otherwise the class is pathname.

The case argument specifies the case of the host, directory, name and type arguments. The other arguments are interpreted using URI case conventions of lower mixed case. The scheme and host arguments are always canonicalized to lower case. The case argument may be either:

:local
The arguments are interpreted using the local case conventions for the resulting pathname class. This is the default. The pathname class conventions may be specialized using the ext:pathname-customary-case and ext:pathname-mixed-case-p.
:common
The arguments are interpreted using the Common Lisp Common pathname case conventions. See the ANSI-CL manual for more information. The use of the :common case convention is recommended if portability with other Common Lisp implementations is important.
:uri
The arguments are interpreted using URI case conventions of lower mixed case. The components are stored internally using URI conventions.

The arguments and their allowed values:

:scheme
The URI scheme. Either a string which is canonicalized to lower case, or the symbol nil, :unspecific or :wild.
:scheme-specific-part
The URI scheme specific part for an opaque URI. Either an appropriately escaped string or the symbol nil, :unspecific or :wild.
:host
The URI authority host. Either an unescaped string which is canonicalized to lower case, or the symbol nil, :unspecific or :wild.
:device
The pathname device. The device component is not implemented. Only the values nil or :unspecific are accepted, and pathname-device will always return :unspecific.
:port
The URI authority port. Either an integer or the symbol nil, :unspecific or :wild.
:username
The URI authority username. Either an unescaped string, or the symbol nil, :unspecific or :wild.
:password
The URI authority password. Either an unescaped string, or the symbol nil, :unspecific or :wild. Note that the use of the password in a URI is not recommended in RFC2396 for security reasons.
:directory
The URI path directory. A list of directories, a string, or the symbol nil, :unspecific, or :wild. A symbol :wild is canonicalized to the list '(:absolute :wild-inferiors), and a symbol :unspecific is canonicalized to the list '(:relative). A string is interpreted as a absolute directory and canonicalized to the list '(:absolute string).

The first element of the directory list should be either :absolute or :relative, and the remaining elements are the directory segments. If a segment does not contain parameters then the associated element is an unescaped string. Otherwise, if a segment contains parameters then the segment element is a list of the unescaped segment name without the parameters and an alist of unescaped parameter names and associated unescaped values.

:name
The URI path name. Either an unescaped string, or the symbol nil, :unspecific or :wild.
:type
The URI path type. Either an unescaped string, or the symbol nil, :unspecific or :wild.
:version
The URI path version. Either an unescaped string, or the symbol nil, :unspecific, :wild or :newest.
:parameters
The URI path parameters for the path segment associated with the name. Either an alist of unescaped parameter names and associated unescaped value(s), or the symbol nil, :unspecific or :wild.

The URI path parameters are separated by #\; and each parameter name is separated from its values by #\=. If the name is not supplied then it is interpreted as an empty string. If there are no values then the associated value is nil. If there is a single value then the associated value is the unescaped string - even if empty. Multiple values are parsed and are placed in a list. For example, the pathname parameters alist for the URI "/file;;x;=1;y=;z=1;p=1==2" is:

(("") ("x" . nil) ("" . "1") ("y" . "") ("z" . "1") ("p" . ("1" "" "2"))

:query
The URI query component. Either an alist of unescaped query names and an associated unescaped value(s), or the symbol nil, :unspecific or :wild.

The URI query arguments are separated by #\& and each argument name is separated from its values by #\=. If the name is not supplied then it is interpreted as an empty string. If there are no values then the associated value is nil. If there is a single value then the associated value is the unescaped string - even if empty. Multiple values are parsed and are placed in a list. A query component with the value "" is represented by the query alist '(("")). For example, the pathname query alist for the URI query "?&x&=1&y=&z=1&p=1==2" is:

(("") ("x" . nil) ("" . "1") ("y" . "") ("z" . "1") ("p" . ("1" "" "2"))

:fragment
The URI fragment component. Either an unescaped string, or the symbol nil, :unspecific or :wild.