From: SourceForge.net <no...@so...> - 2008-09-30 07:09:57
|
Bugs item #2137670, was opened at 2008-09-30 09:09 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103235&aid=2137670&group_id=3235 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Michael Weber (wleahcim) Assigned to: Nobody/Anonymous (nobody) Summary: COLLECT-FIRST optimization bug Initial Comment: COLLECT-FIRST sometimes returns the last element: (let ((nums (scan-range :below 4))) (values (collect-first nums) (collect (subseries nums 0)))) => 3, (0 1 2 3) Macroexpanding the form shows that there is a test missing: #:LL-1945 (SETQ NUMS (+ NUMS (SERIES::COERCE-MAYBE-FOLD 1 'NUMBER))) (IF (NOT (< NUMS 4)) (GO SERIES::END)) ;; MISSING: (IF #:TERMINATED-1944 (GO #:CC-1943)) (SETQ #:ITEM-1929 NUMS) #:BB-1942 (SETQ #:TERMINATED-1944 T) #:CC-1943 (INCF #:INDEX-1938) Note that the following versions work: (let ((nums (scan-range :below 4))) (values (collect-first nums) (collect nums))) => 0, (0 1 2 3) (let ((nums (scan-range :below 4))) (values (collect-first nums) (subseries nums 0))) ; return series, i.e., no optimization => 0, #Z(0 1 2 3) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103235&aid=2137670&group_id=3235 |