Hacker News new | ask | show | jobs
by shawn_w 546 days ago
I think any language that has a flatmap type construct would also have filter functions that would be a lot clearer to read and write...

    (remove-if #'evenp '(1 2 3))
vs

    (mapcan
      (lambda (n) (if (evenp n) '() (list n)))
      '(1 2 3))
in Common Lisp for example.

(Yes I know the original is just a contrived example that you shouldn't read too much into, but...)