Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.lisp
Re: I still don't get MAPCAN
William James
11/4/2015 11:41:00 PM
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))
>
> ick.
>
> (loop for e in huge-list when (interestingp e) collect e)
Gauche Scheme:
(filter interesting? huge-list)
Only a dung-beetle (a worshipper of CL) would prefer Kenny's version.
MatzLisp (Ruby):
huge_array.select(&:interesting?)
or
huge_array.select{|x| interesting?(x)}
--
You have politicians saying that ... as many Africans as want to come into
Sweden should be able to come.... They've already said that everybody from
Syria can come to Sweden.... [T]hey are actually thinking of commandeering
people's vacation homes because they need more housing for immigrants.
--- Dr. Kevin MacDonald (
http://lnrlive.com/tpc/tpc201...
)
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: I still don't get MAPCAN
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password