Re: I still don't get MAPCAN



On 2006-08-17 20:39:00 +0100, Ken Tilton <kentilton@xxxxxxxxx> said:


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))

ick.

(loop for e in huge-list when (interestingp e) collect e)

Well, sure.



--tim (and that's the first Lisp I've written for nearly 2 years!)

Still rebuilding after the weight of all those Java references collapsed the home?

No, I find Java fine for what I use it for (for instance generating hand-crafted syslog packets or something). I just don't really write programs any more, I `architect security solutions' or some such bull***. I'm sure I'd use Lisp if I did program.

--tim

.


Loading