aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-08-02 02:55:18 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-09-18 22:53:57 +0200
commit23cf6047ae320a1d666ddf6418bade67dfa95ada (patch)
tree1f5897d93efa3ed8de49ce4ebd199b40106f29ea /doc
parentExtend module-imports to work on non-module scheme files. (diff)
downloadcalp-23cf6047ae320a1d666ddf6418bade67dfa95ada.tar.gz
calp-23cf6047ae320a1d666ddf6418bade67dfa95ada.tar.xz
Add procedure relative-to.
Diffstat (limited to 'doc')
-rw-r--r--doc/ref/guile/util-path.texi17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/ref/guile/util-path.texi b/doc/ref/guile/util-path.texi
index 2a53ba91..cf99a170 100644
--- a/doc/ref/guile/util-path.texi
+++ b/doc/ref/guile/util-path.texi
@@ -43,3 +43,20 @@ Returns the extension of the filename, or the empty string if none exists.
Equivalent of realpath(3). Absolute file names are returned as is,
while relative filenames gets expanded to absolute filenames.
@end defun
+
+@defun relative-to base path
+Returns @var{path} as a relative path relative to @var{base}.
+
+base must be non-empty
+@example
+(relative-to "/some" "/some/path")
+;; ⇒ "path"
+
+(relative-to "/some" "/other/path/")
+;; ⇒ "../path"
+
+(relative-to "/a/b/c" "/a/b")
+;; ⇒ "/a/b"
+@end example
+
+@end defun