From Newsgroup: comp.lang.lisp
Ken Tilton wrote:
MAPCAN is terribly useful when you want to collect only some things:
(defun find-interesting (huge-list)
(mapcan #'(lambda (e) (if (interestingp e) (list e) nil)) huge-list))
Why wasn't it simply:
(mapcan (lambda (e) (if (interestingp e) (list e) nil)) huge-list))
Users of CL (COBOL-Like) are extremely eager to make their
code as ugly as possible.
ick.
(loop for e in huge-list when (interestingp e) collect e)
Ick.
Scheme:
(filter interesting? huge-list)
--- Synchronet 3.21d-Linux NewsLink 1.2