Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rutils.iter: fix defclause-sequence drivers #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jcguy
Copy link

@jcguy jcguy 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.
@jcguy jcguy force-pushed the fix-in-sequence branch from 0e8b548 to 14668c3 Compare March 10, 2024 23:03
@jcguy jcguy 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