Closed faeredia closed 1 year ago
Something like this seems to work
(defun iota-sum-array (array index-origin)
(let* ((output (make-array (butlast (april::array-to-list array))))
(last (aref array (1- (length array))))
(last-sum (iota-sum last)))
(across
output
(lambda (elm coords)
(declare (ignore elm))
(setf (apply #'aref output coords)
(concatenate 'vector
(map 'vector (lambda (x)
(* last (+ x index-origin)))
coords)
(vector last-sum)))))
output))
I'll test a bit and include in #239
This now works.
The +/⍳ optimisation (iota-sum) doesn't handle array arguments, like
2 5
gives an error:The offending
<
is in spec.lisp,match-function-patterns
in the first branchDyalog says: