diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-06-12 07:28:34 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-06-12 07:28:34 -0700 |
commit | a8b0d63648fcaa91df58a8fcc7c7072fba9a7407 (patch) | |
tree | ef9cf07085ee7ade9fceb15be21262964f8c0a77 /ffi.c | |
parent | d743537013689e80cb1ede22dbb4e241d601b6ea (diff) | |
download | txr-a8b0d63648fcaa91df58a8fcc7c7072fba9a7407.tar.gz txr-a8b0d63648fcaa91df58a8fcc7c7072fba9a7407.tar.bz2 txr-a8b0d63648fcaa91df58a8fcc7c7072fba9a7407.zip |
ffi: adjust in semantics of variable zarray.
The replace function now returns a list if a nil object's is
replaced with a range, rather than just returning the original
item sequence. This breaks the variable array in operation,
causing it to produce a list. We fix this sproblem, and also
the nonsense semantics of the operation also; the operation
should replace the original sequence, with the array,
similarly to how null terminated strings work.
* ffi.c (ffi_varray_null_term_in): If the original Lisp object
isn't nil, then assume it's a sequence and replace it with the
items gathered in the vector. Otherwise, replace it with the
vector.
* txr.1: Adjust documentation.
Diffstat (limited to 'ffi.c')
-rw-r--r-- | ffi.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2456,7 +2456,7 @@ static val ffi_varray_null_term_in(struct txr_ffi_type *tft, int copy, mem_t *sr offs += elsize; } - return replace(vec_in, vec, zero, length_vec(vec)); + return if3(vec_in, replace(vec_in, vec, zero, t), vec); } static val ffi_varray_null_term_get(struct txr_ffi_type *tft, mem_t *src, |