compiler: fix compiler-macro for `FIND'

C-compiled `FIND' didn't respect `START' nor `END' arguments due to bug
in parsing the arguments and invoking `DO-SEQ'. Fixes #199.
This commit is contained in:
Daniel Kochmański 2015-12-18 10:35:11 +01:00
parent f49fd1ea81
commit af9900c7d4
2 changed files with 7 additions and 2 deletions

View file

@ -119,6 +119,9 @@
- Fix `listen' on streams when FILE_CNT isn't available (use read instad
of fread)
- `FIND' compiled with C compiler didn't respect `START' nor `END'
arguments. Compiler macro is fixed now and should work as expected
* 16.0.0 changes since 15.3.7
** API changes

View file

@ -101,7 +101,9 @@
(nconc key-init test-init)
key-flag
test-flag
test))))))
test
start
end))))))
#+(or)
(define-compiler-macro si::make-seq-iterator (seq &optional (start 0))
@ -275,7 +277,7 @@
(ext:with-unique-names (%value %elt)
`(let ((,%value ,value)
,@init)
(do-in-seq (,%elt ,sequence)
(do-in-seq (,%elt ,sequence :start ,start :end ,end)
(when ,(funcall test-function %value
(funcall key-function %elt))
(return ,%elt))))))))