I'm puzzled. I have a function:
(defun sum-of-signs (s d)
(let ((returns (map-fn 'float #'-
(subseries s 0 d)
(subseries s 1 (+ d 1)))))
(collect-fn 'float
#'(lambda () 0)
#'(lambda (v1 v2)
(+ v1 (signum v2)))
returns)))
which doesn't work correctly. I get a warning:
Warning 28 in series expression:
(COLLECT-FN 'FLOAT
#'(LAMBDA () 0)
#'(LAMBDA (V1 V2) (+ V1 (SIGNUM V2)))
RETURNS)
Non-series to series data flow from:
RETURNS
to:
(COLLECT-FN 'FLOAT
#'(LAMBDA () 0)
#'(LAMBDA (V1 V2) (+ V1 (SIGNUM V2)))
RETURNS)
; In: LAMBDA (#:G1159)
; (COLLECT-FN 'FLOAT #'(LAMBDA # 0) #'(LAMBDA # #) RETURNS)
; Warning:
;
And the return value is 0 for my test cases.
Testing the collect-fn form with sample data generated by (scan '(1 2
3)) gives correct results. But somehow collect-fn won't accept the
series data returned by map-fn, even though setting a breakpoint and
checking (type-of returns) gives the expected SERIES::BASIC-SERIES.
What am I doing wrong?
--J.
PS: CMUCL-18e.