Skip to content

Conversation

@corderguy
Copy link

@corderguy corderguy commented Mar 10, 2024

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

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.
@corderguy corderguy changed the title rutils.iter: fix defcaluse-sequence drivers rutils.iter: fix defclause-sequence drivers Mar 10, 2024
@jcguu95
Copy link

jcguu95 commented Apr 29, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RUTILS.ITER:ITER, :in-vector or :in-sequence "The value NIL is not of type NUMBER"

2 participants