diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-06-13 21:08:23 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-06-13 21:08:23 -0700 |
commit | 04083a6ce6e16ed8af92996ab85cd740fd19759a (patch) | |
tree | 6fa05aa0c800dcbf1978fb8d63e02e5f796a146a /share | |
parent | 9b64a129d691fa3e4a08dacbd6e2c697bb4a857f (diff) | |
download | txr-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.tl | 3 |
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)) |