diff options
-rw-r--r-- | share/txr/stdlib/ffi.tl | 4 | ||||
-rw-r--r-- | txr.1 | 15 |
2 files changed, 14 insertions, 5 deletions
diff --git a/share/txr/stdlib/ffi.tl b/share/txr/stdlib/ffi.tl index ed8ad06d..6bbd43a9 100644 --- a/share/txr/stdlib/ffi.tl +++ b/share/txr/stdlib/ffi.tl @@ -145,8 +145,8 @@ (define-accessor carray-ref carray-refset) -(define-place-macro carray-sub (carray : (from 0) (to t)) - ^(sub ,carray ,from ,to)) +(defset carray-sub (carray : (from 0) (to t)) items + ^(progn (carray-replace ,carray ,items ,from ,to) ,items)) (defmacro znew (type . pairs) (if (oddp (length pairs)) @@ -65108,9 +65108,18 @@ and modifications in the original are not reflected in the subrange. If .code carray-sub -is used as a syntactic place, behaves exactly like the -.code sub -accessor, via a place macro substitution to that form. +is used as a syntactic place, the argument expressions +.metn carray , +.metn from , +.meta to +and +.meta new-val +are evaluated just once. The prior value, if required, is accessed by calling +.code carray-sub +and +.meta new-val +is then stored via +.codn carray-replace . .coNP Function @ carray-replace .synb |