diff options
| author | 2024-12-24 08:45:57 -0500 | |
|---|---|---|
| committer | 2024-12-24 08:45:57 -0500 | |
| commit | 066431d7865fdc0a25be4f5f8259fcd80ea45d3d (patch) | |
| tree | 2da8eefe455944503bd1be10b1b0e81eabdb54a4 /generic-iterator.scm | |
| parent | make iterator-advance only take integers (diff) | |
Revert generic-iterator to allow for any value for iterator-advance
Scheme is a dynamic language, users should have the freedom to use
whatever value they wish to advance the iterator or to use as the
index.
The implementations of iterator-advance I have written require case
analysis anyways, so there is no point to adding a case analysis
branch before them.
Diffstat (limited to '')
| -rw-r--r-- | generic-iterator.scm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/generic-iterator.scm b/generic-iterator.scm index ee5ac9e..960f9da 100644 --- a/generic-iterator.scm +++ b/generic-iterator.scm @@ -54,11 +54,10 @@ get-end-predicate "no end predicate") -(define-with-field-of-iterator (iterator-advance get-advance spaces) +(define-invoke-field-of-iterator iterator-advance + get-advance "no advance procedure" - (if (not (integer? spaces)) - (error "must advance an integer amount" spaces) - (get-advance spaces))) + spaces) (define-invoke-field-of-iterator iterator-ref get-ref |
