[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.lisp

Re: Loop macro - why?

William James

4/30/2015 10:14:00 AM

Don Geddis wrote

> I don't know about you, but it's _much_ easier for me to understand this
> oh-so-common idiom with the extended loop:
>
> (loop for x in *big-list*
> collect (1+ x) )

Gauche Scheme:

gosh> (define big-list (iota 8))
big-list
gosh> (map (cut + 200 <>) big-list)
(200 201 202 203 204 205 206 207)
gosh> (map (pa$ + 200) big-list)
(200 201 202 203 204 205 206 207)

--
"It is not as wrong raping a Swedish girl as raping an Arab girl," says Hamid,
in an interview about a gang rape involving a Swedish girl and immigrant
perps.... [T]his massive spike in rapes is caused by mass immigration ... that
.... international organizations want to continue ... until the native
population has been reduced to a persecuted minority.
--- amren.com/news/2009/09/sweden_tops_eur/
1 Answer

William James

12/2/2015 4:32:00 AM

0

WJ wrote:

> Don Geddis wrote
>
> > I don't know about you, but it's _much_ easier for me to understand this
> > oh-so-common idiom with the extended loop:
> >
> > (loop for x in *big-list*
> > collect (1+ x) )

Ocaml:

List.map ((+) 1) [200;300;400;500];;

===>
[201; 301; 401; 501]

--
The urge to save humanity is almost always only a false face for
the urge to rule it. --- H. L. Mencken