rutils icon indicating copy to clipboard operation
rutils copied to clipboard

rutils.iter: fix defclause-sequence drivers

Open corderguy opened this issue 1 year ago • 1 comments

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

corderguy avatar Mar 10 '24 23:03 corderguy

@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)

jcguu95 avatar Apr 29 '24 15:04 jcguu95