diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-06-11 22:52:31 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-06-11 22:52:31 -0700 |
commit | a540359de7335436fe431e46ae18a9823c01155a (patch) | |
tree | 7ca9068c22a6ca11135a4c98c6bff84ddcac3d2a /lib.c | |
parent | 082132f7d5d86068ab733f49fc4c43a9bd6157f1 (diff) | |
download | txr-a540359de7335436fe431e46ae18a9823c01155a.tar.gz txr-a540359de7335436fe431e46ae18a9823c01155a.tar.bz2 txr-a540359de7335436fe431e46ae18a9823c01155a.zip |
ffi: new carray-replace function.
Thanks to this (set [ca from..to] list) works.
* ffi.c (carray_replace): New function.
(ffi_init): Register carray-replace intrinsic.
* ffi.h (carray_replace): Declared.
* ffi.c (replace): Hook in carray_replace.
* txr.1: Mention carray under replace, and document
carray-replace.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -9263,6 +9263,10 @@ val replace(val seq, val items, val from, val to) return replace_str(seq, items, from, to); case VEC: return replace_vec(seq, items, from, to); + case COBJ: + if (seq->co.cls == carray_s) + return carray_replace(seq, items, from, to); + /* fallthrough */ default: type_mismatch(lit("replace: ~s is not a sequence"), seq, nao); } |