diff options
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) |