rutils
rutils copied to clipboard
rutils.iter: fix defclause-sequence drivers
Defaults step in return-seq-code to 1.
Currently, all drivers that use defclause-sequence are broken, because step is not bound before return-sequence-code is called. This results in step being bound to nil, which means initial-value is set to (- nil) and step-code is set to something like (+ index nil). This change causes step to default to 1 if it is not provided.
Fixes #61 #67
@jcguy Thanks for the change!
I added a lot of tests from the traditional ITERATE system.
Surprisingly, there are several potential bugs in RUTILS:ITER.
;;; https://gitlab.common-lisp.net/iterate/iterate/-/blob/master/iterate-test.lisp
;;; (commit: 8f3f239d0efd67a827bf7c78df08d43f676a7302)