[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.lisp

Re: Python syntax in Lisp and Scheme

William James

7/30/2015 7:03:00 PM

Hartmann Schaffer wrote:

> the version he gave has the advantage that it doesn't clutter up the
> namespace of the environment. with
>
> (map (lambda (x) (+ x offset)) the-list)
>
> you have everything that is relevant in the immediate neighborhood of
> the statement. with a separate defun you have to search the program
> to see what the function does. i agree that for lengthy functions
> defining it separately and just writing the name is preferrable.

Gauche Scheme:

(map (pa$ + offset) the-list)

Another way:

(map (cut + offset <>) the-list)

--
[Jesse Jackson] would spit into the food of white patrons he hated and then
smilingly serve it to them. He did this, he said, "because it gave me
psychological gratification." -- Life Magazine, 1969-11-29
Blacks are an estimated 39 times more likely to commit a violent crime
against a white than vice versa, and 136 times more likely to commit robbery.
www.colorofcrime.com/2005/10/the-color-of-crime-2005/
1 Answer

William James

3/30/2016 12:31:00 AM

0

WJ wrote:

> Hartmann Schaffer wrote:
>
> > the version he gave has the advantage that it doesn't clutter up the
> > namespace of the environment. with
> >
> > (map (lambda (x) (+ x offset)) the-list)
> >
> > you have everything that is relevant in the immediate neighborhood of
> > the statement. with a separate defun you have to search the program
> > to see what the function does. i agree that for lengthy functions
> > defining it separately and just writing the name is preferrable.
>
> Gauche Scheme:
>
> (map (pa$ + offset) the-list)
>
> Another way:
>
> (map (cut + offset <>) the-list)


OCaml:

List.map ((+) 500) [2;3;4;5] ;;
===>
[502; 503; 504; 505]

--
Europe is not going to be the monolithic societies that they once were in the
last century.... They are now going into a multicultural mode. Jews will be
resented because of our leading role. --- Barbara Spectre
http://archive.org/download/DavidDuke_videos/HowZionistsDivideAndConquer-fjjsz...