diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-09-27 06:52:46 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-09-27 06:52:46 -0700 |
commit | f6d726cd185524fef00572b2e18a186926222b29 (patch) | |
tree | f1f543ef05ee35b75031a4276bfca16f7ada9e55 /txr.1 | |
parent | 25f06fa13e92347e9a4d3e506473642e593aeccc (diff) | |
download | txr-f6d726cd185524fef00572b2e18a186926222b29.tar.gz txr-f6d726cd185524fef00572b2e18a186926222b29.tar.bz2 txr-f6d726cd185524fef00572b2e18a186926222b29.zip |
New function pure-rel-path-p.
* stream.c (plp_regex): New static variable.
(pure_rel_path_p): New function.
(stream_init): gc-protect plp_regex.
Register pure-rel-path-p intrinsic.
* txr.1: Document pure-rel-path-p and slightly revise abs-path-p.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 50 |
1 files changed, 48 insertions, 2 deletions
@@ -36701,6 +36701,8 @@ An absolute path is a string which either begins with a slash or backslash character, or which begins with an alphanumeric word, followed by a colon, followed by a slash or backslash. +The empty string isn't an absolute path. + Examples of absolute paths: .cblk @@ -36711,16 +36713,60 @@ Examples of absolute paths: Z:\eUsers .cble -Examples of strings which are not absolute paths. +Examples of strings which are not absolute paths: .cblk -.mets < (the < empty < string) +.mets >> ( the < empty << string ) . abc foo:bar/x $:\eabc .cble +.coNP Function @ pure-rel-path-p +.synb +.mets (pure-rel-path-p << path ) +.syne +.desc +The +.code pure-rel-path-p +function tests whether the string +.meta path +represents a +.IR "pure relative path" , +which is defined as a path which isn't absolute according to +.codn abs-path-p , +which isn't the string +.str . +(single period), +which doesn't begin with a period followed by a slash or backslash, +and which doesn't begin with alphanumeric word +terminated by a colon. + +The empty string is a pure relative path. + +Other examples of pure relative paths: + +.cblk + abc.d + .tmp/bar + 1234 + x + $:/xyz +.cble + +Examples of strings which are not pure relative paths: + +.cblk + . + / + /etc + ./abc + .\e + foo: + $:\eabc +.cble + .coNP Functions @ read and @ iread .synb .mets (read >> [ source >> [ error-stream >> [ error-retval <> [ name ]]]]) |