Hacker News new | past | comments | ask | show | jobs | submit login

Iterate also breaks the count function. Or did the last time I tried to use it.



What do you mean?


Just checked and this is still a problem. Try this code with Iterate:

  (let ((list '(1 2 3 4 1 2 3 4))) ;; or whatever other sequence
    (iter (for i from 1 to 10)
          (sum (count i list))))
It will error out on you. The same works fine with loop:

  (let ((list '(1 2 3 4 1 2 3 4)))
    (loop for i from 1 to 10
          sum (count i list))) ;; => 8
Now, that's a bit contrived as an example, but an iteration library should not break a standard library function call.

https://gitlab.common-lisp.net/iterate/iterate/-/issues/12 - Apparently it's known and they intend to remove it in 2.0, which isn't out yet.


good to know, thanks




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: