vseloved / rutils

Radical Utilities for Common Lisp
Other
250 stars 37 forks source link

core/iter: Fix “:by” clause in numerical iteration #49

Closed clearyf closed 4 years ago

clearyf commented 4 years ago

This is reverting back to what is present in the original "iterate" code; I’m not sure what prompted this change in rutils but this version is present in git since the file was added. The existing version with the extra parens was triggering an "Unknown keyword BY" error in all attempts to use :by in a numerial :for loop, eg:

(iter (:for i :from 0 :below 10 :by 2) (print i))

Iterate, in (FOR I FROM 0 BELOW 10 BY 2):
Unknown keyword BY
   [Condition of type SIMPLE-ERROR]

Tested with sbcl 2.0.0 from nixpkgs.

vseloved commented 4 years ago

Thanks for the fix and sorry for a long response. In fact, it should be :by (:by 1) - as rutils foesn't support non-keyword keywords. The change will be in the next release