[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

Re: Lisp help

William James

7/24/2015 12:12:00 PM

Kent M. Pitman wrote:

> You can also, in CL, use LOOP. It has its own quite complex syntax,
> which you have to learn separately, but you should know it's an available
> option:
> (loop for x in '(1 3 v a)
> when (numberp x)
> collect x) => (1 3)

Gauche Scheme:

(filter number? '(1 3 v a))

> or
> (loop for x in '(1 3 v a)
> when (numberp x)
> sum x) => 4

(use srfi-42 :only (sum-ec))
(sum-ec (: x '(1 3 v a)) (if (number? x)) x)

--
Sweden is already a banana republic, perhaps on its way to becoming an Islamic
republic. Swedish culture is disappearing with astonishing speed in front of
our eyes. If the trend isn't stopped, the Swedish nation will simply cease to
exist in any meaningful way during the first half of this century.
fjordman.blogspot.ca/2005/05/is-swedish-democracy-collapsing.html