Closed gambiteer closed 6 months ago
I fixed some of these. For the tests with zero-dimensional arrays, they have a single index (the empty list), corresponding to a single element, so your examples giving them no elements throw an exception. i.e.
(list*->array 0 '()) => exception
(list*->array 0 '(3)) => ok
This seems to be the correct interpretation to me? Interestingly, zero-dimensional arrays are the only dimension that can't be empty.
Re:
(list*->array 0 '()) => exception
(list*->array 0 '(3)) => ok
The first one returns a zero-dimensional array whose sole element is the empty list, the second a zero-dimensional array whose sole element is the list '(3).
Ah, right, thanks. I'm thinking too much in terms of tensors, and the examples putting lists in arrays keep throwing me off...
I still see these errors:
ERROR: (array-every equal? (list*->array 1 '()) (make-array (make-inte...
Exception: car: not a pair: ()
on line 766 of file "test-arrays.scm"
(array-every equal? (list*->array 1 '()) (make-array (make-interval '#(0)) (lambda () (error))))
ERROR: (array-every equal? (list*->array 2 '()) (make-array (make-inte...
Exception: car: not a pair: ()
on line 769 of file "test-arrays.scm"
(array-every equal? (list*->array 2 '()) (make-array (make-interval '#(0 0)) (lambda () (error))))
ERROR: (array-every equal? (list*->array 2 '(() ())) (make-array (make...
Exception: car: not a pair: ()
on line 772 of file "test-arrays.scm"
(array-every equal? (list*->array 2 '(() ())) (make-array (make-interval '#(2 0)) (lambda () (error))))
ERROR: (array-every equal? (vector*->array 1 '#()) (make-array (make-i...
Exception: vector-ref: index out of range
#()
0
on line 796 of file "test-arrays.scm"
(array-every equal? (vector*->array 1 '#()) (make-array (make-interval '#(0)) (lambda () (error))))
ERROR: (array-every equal? (vector*->array 2 '#()) (make-array (make-i...
Exception: vector-ref: index out of range
#()
0
on line 799 of file "test-arrays.scm"
(array-every equal? (vector*->array 2 '#()) (make-array (make-interval '#(0 0)) (lambda () (error))))
ERROR: (array-every equal? (vector*->array 2 '#(#() #())) (make-array ...
Exception: vector-ref: index out of range
#()
0
on line 802 of file "test-arrays.scm"
(array-every equal? (vector*->array 2 '#(#() #())) (make-array (make-interval '#(2 0)) (lambda () (error))))
I found these this morning, I don't know whether it's a problem with interval cursors,
array-every
,interval-fold
, ... (or the tests)