summaryrefslogtreecommitdiffstats
path: root/ffi.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-06-11 11:03:40 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-06-11 11:03:40 -0700
commit0687743dcfad79dba202b4411a5b51f6954cf3b2 (patch)
tree870fa9b01025fc28c5171c55fb1bb62278ee390e /ffi.h
parent05e9ac4bd7a26c6c5b5979efca64260f7d38970c (diff)
downloadtxr-0687743dcfad79dba202b4411a5b51f6954cf3b2.tar.gz
txr-0687743dcfad79dba202b4411a5b51f6954cf3b2.tar.bz2
txr-0687743dcfad79dba202b4411a5b51f6954cf3b2.zip
ffi: support sel operation on carray.
Thus (select ca '(0 3 4 ...)) works and so does the sytnax [ca '(0 3 4 ...)]. This is inefficiently implemented. The selected elements are extracted to a list which is then converted to a carray of the same kind agan. * ffi.c (carray_list): New function. (ffi_init): Register carray-list intrinsic. * ffi.h (carray_list): Declared. * lib.c (make_like): Add carray case, so we can turn a list into a carray based on an example carray. This uses carray_list, with the type pulled from the original carray. The target isn't null terminated. (sel): Handle carray via vector case. * txr.1: Document changes in select and make-like.
Diffstat (limited to 'ffi.h')
-rw-r--r--ffi.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/ffi.h b/ffi.h
index 88557b7b..2e88f167 100644
--- a/ffi.h
+++ b/ffi.h
@@ -95,6 +95,7 @@ val carray_type(val carray);
val length_carray(val carray);
mem_t *carray_ptr(val carray, val type, val self);
val carray_vec(val vec, val type, val null_term_p);
+val carray_list(val list, val type, val null_term_p);
val carray_blank(val nelem, val type);
val carray_buf(val buf, val type);
val carray_buf_sync(val carray);