Hacker Newsnew | past | comments | ask | show | jobs | submit | ogroide's commentslogin

Is not the same, in lisp :count 5 means that you remove at most 5 elements, so that the result can be a list of 100 elements, while take 5 will always produce a sequence with at most 5 elements.

(remove-if-not #'evenp (loop for i below 10 collect i) :count 3 :start 0) result is (0 2 4 6 7 8 9), there are three elements deleted.


Well, that is different, but I suppose the Haskell example suffers from the same difference then.


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

Search: