diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:06:40 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:06:40 -0800 |
commit | a69c9fb665459e2bfdbda1bf80741a0af31a7faf (patch) | |
tree | f0bc974f8805049e6b9a4e6864886298fbaa05a4 /subarray.scm | |
parent | 4684239efa63dc1b2c1cbe37ef7d3062029f5532 (diff) | |
download | slib-upstream/3b5.tar.gz slib-upstream/3b5.zip |
New upstream version 3b5upstream/3b5upstream
Diffstat (limited to 'subarray.scm')
-rwxr-xr-x[-rw-r--r--] | subarray.scm | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/subarray.scm b/subarray.scm index 9f84583..949a7a4 100644..100755 --- a/subarray.scm +++ b/subarray.scm @@ -18,14 +18,15 @@ ;each case. (require 'array) +(require 'multiarg-apply) ;;@code{(require 'subarray)} ;;@ftindex subarray -;;@body -;;selects a subset of an array. For @1 of rank n, there must be at least -;;n @2 arguments. For 0 <= @i{j} < n, @2@i{j} is either an integer, a -;;list of two integers within the range for the @i{j}th index, or #f. +;;@args array select @dots{} +;;selects a subset of an array. For 0 <= @i{j} < n, @2@i{j} is either +;;an integer, a list of two integers within the range for the @i{j}th +;;index, or #f. ;; ;;When @2@i{j} is a list of two integers, then the @i{j}th index is ;;restricted to that subrange in the returned array. @@ -63,7 +64,8 @@ ;;#1A(e d c b a) ;;@end example (define (subarray array . selects) - (apply make-shared-array array + (apply make-shared-array + array (lambda args (let loop ((sels selects) (args args) |