Broken test for IOTA
See this commit: 1e5b8e8f
Test iota.fp-start-and-complex-integer-step
was designed to test that calling iota
with the (real) float start and complex (integer) step resulted a sequence of complex numbers. It was then incorrectly fixed because it was failing on CLISP.
I believe that test was failing because of CLISP bug, not because it was broken.
iota
uses a somewhat kludgy hack for returning a correct type as its first element: (+ (- (+ start step) step)
as the first element in sequence.
This doesn't work on CLISP because of the following behavior:
(+ 0.0 #C(0 2)) ; => #C(0.0 2)
Note the imagpart being 2
and not 2.0
.
Per https://www.lispworks.com/documentation/HyperSpec/Body/t_comple.htm
The real part and imaginary part are either both rational or both of the same float type.
But on CLISP (including when running with -ansi
flag):
(complexp (complex 2.0 2)) ; => T
(type-of (realpart (complex 2.0 2))) ; => SINGLE-FLOAT
(type-of (imagpart (complex 2.0 2))) ; => (INTEGER 0 281474976710655)