14.2 Cross-Platform Paths
A cross-platform path value represents a filesystem path combined with #'unix or #'windows to indicate the filesystem’s path convention. A cross-platform path whose convention matches the current host system is also a path. The . operator can be used on a cross-platform path expression in the same way as path expressions.
Cross-platform paths are comparable the same as paths, which means that generic operations like < and > work on paths, cross-platform paths, and combinations. Paths with the #'unix convention are ordered before paths with the #'windows convention.
enumeration | |||
| |||
annotation | |||
| |||
annotation | |||
| |||
annotation | |||
| |||
annotation | |||
| |||
annotation | |||
| |||
annotation | |||
| |||
annotation | |||
| |||
annotation | |||
Every Path is also a CrossPath, and Path.convention for a Path will produce the same symbol as CrossPath.Convention.current(). Operations on CrossPaths also work on Path, but they typically do not accept strings, instead requiring Path or CrossPath values that have an associated convention.
function | ||||
| ||||
| ||||
function | ||||
| ||||
| ||||
function | ||||
|
The CrossPath.Unix and CrossPath.Windows functions are shorthands for CrossPath with #'unix and #'windows, respectively.
> p.string()
"/home/rhombus/shape.txt"
> p.convention()
#'unix
binding operator | |
> bstr
#"/home/rhombus/shape.txt"