summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-06-13 21:08:23 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-06-13 21:08:23 -0700
commit04083a6ce6e16ed8af92996ab85cd740fd19759a (patch)
tree6fa05aa0c800dcbf1978fb8d63e02e5f796a146a /share
parent9b64a129d691fa3e4a08dacbd6e2c697bb4a857f (diff)
downloadtxr-04083a6ce6e16ed8af92996ab85cd740fd19759a.tar.gz
txr-04083a6ce6e16ed8af92996ab85cd740fd19759a.tar.bz2
txr-04083a6ce6e16ed8af92996ab85cd740fd19759a.zip
ffi: turn carray-sub into accessor.
* lisplib.c (ffi_set_entries): Register carray-sub for autoload. * share/txr/stdlib/ffi.tl (carray-sub): New place macro, aliases to sub. This is not 100% correct since that means it will admit non-carray objects, but the alternative is to clone the entire sub expander with a few changes, or else factor out sub expansion into a shared routine. Bleh ... * txr.1: Documented. We don't cover up the ruse we perpetrated, and reveal that it's just a place macro targetting sub.
Diffstat (limited to 'share')
-rw-r--r--share/txr/stdlib/ffi.tl3
1 files changed, 3 insertions, 0 deletions
diff --git a/share/txr/stdlib/ffi.tl b/share/txr/stdlib/ffi.tl
index da29c1e5..a041692f 100644
--- a/share/txr/stdlib/ffi.tl
+++ b/share/txr/stdlib/ffi.tl
@@ -133,3 +133,6 @@
^(ffi-type-compile ',type))
(define-accessor carray-ref carray-refset)
+
+(define-place-macro carray-sub (carray : (from 0) (to t))
+ ^(sub ,carray ,from ,to))