Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.lisp
Re: Simple recursive list processing question
William James
8/28/2015 4:20:00 PM
Alan Crowe wrote:
> >
> > (reduce #'(lambda (x y) (if y (+ x y) x))
> > some-list
> > :initial-value 0)
> >
> Using a key function has a certain charm
>
> (defun summit (list)
> (reduce (function +) list
> :key (lambda(n)
> (typecase n
> (number n)
> (t 0)))))
Gauche Scheme:
(fold
(lambda (x sum) (+ sum (or x 0)))
0
'(#f 200 8))
===>
208
--
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: Simple recursive list processing question
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