diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-06-15 21:48:49 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-06-15 21:48:49 -0700 |
commit | f301e8071b32552f8096286ae7c978ab9e79061c (patch) | |
tree | 706db4722d98dc283b7663ea58d93884596807c3 /txr.1 | |
parent | 3f87793404053b98fe0f6a20fafaf7e841f23f71 (diff) | |
download | txr-f301e8071b32552f8096286ae7c978ab9e79061c.tar.gz txr-f301e8071b32552f8096286ae7c978ab9e79061c.tar.bz2 txr-f301e8071b32552f8096286ae7c978ab9e79061c.zip |
buffers: expose sub-buf and replace-buf.
* buf.c (buf_init): Intrinsics sub-buf and replace-buf
registered.
* txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 59 |
1 files changed, 59 insertions, 0 deletions
@@ -26873,6 +26873,13 @@ object, then the function behaves like If .meta sequence +is a +.code buf +object, then the function behaves like +.codn buf-sub . + +If +.meta sequence is a structure, it must support the .code lambda method. The @@ -27051,6 +27058,15 @@ behaves like If .meta sequence +is a +.code buf +object, then +.code replace +behaves like +.codn buf-replace . + +If +.meta sequence is a structure, then the structure must support the .code lambda-set method. The @@ -59542,6 +59558,49 @@ which has the same length and contents, and compares to .metn buf . +.coNP Function @ sub-buf +.synb +.mets (sub-buf < buf >> [ from <> [ to ]]) +.syne +.desc +The +.code sub-buf +function has the same semantics as the +.code sub +function, except that the first argument must be a buffer. + +The extracted sub-range of a buffer is itself a buffer object. + +For a description of the arguments and semantics, refer to the +.code sub +function. + +.coNP Function @ replace-buf +.synb +.mets (replace-buf < buf < item-sequence >> [ from <> [ to ]]) +.syne +.desc +The +.code replace-buf +function has the same semantics as the +.code replace +function, except that the first argument must be a buffer. + +The elements of +.code item-sequence +are stored into +.meta buf +as if using the +.code buf-put-u8 +function and therefore must be suitable +.meta val +arguments for that function. + +The of the arguments, semantics and return value given for +.code replace +apply to +.codn replace-buf . + .coNP Function @ buf-put-i8 .synb .mets (buf-put-i8 < buf < pos << val ) |