[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.lisp

Re: Use Java! Was: becoming a better programmer

William James

7/13/2015 1:15:00 PM

> Or how about an iteration example using only standard features:
>
> (let ((list '(("Joe" 23 "Mechanic")
> ("Amy" 41 "Executive")
> ("Bob" 31 "Programmer"))))
> (loop for (name age occupation)
> in list
> do (format t "name: ~a, age: ~a, occupation ~a~%"
> name age occupation)))
>
> Output:
>
> name: Joe, age: 23, occupation Mechanic
> name: Amy, age: 41, occupation Executive
> name: Bob, age: 31, occupation Programmer

Gauche Scheme:

(let1 men '(("Sepp" 23 "Mechanic")
("Dolf" 41 "Executive")
("Ivan" 31 "Programmer"))
(for-each
(pa$ apply format #t "name: ~a, age: ~a, occupation ~a~%")
men))

===>
name: Sepp, age: 23, occupation Mechanic
name: Dolf, age: 41, occupation Executive
name: Ivan, age: 31, occupation Programmer

--
The figures on Muslim rape of Western women in Europe are astounding. In
Denmark and Norway, between 65% and 70% of all rapes are committed by Muslims,
who as yet still less than 5% of the population. One local judge in Norway
actually exonerated one rapist by accepting his defense that the victim's dress
was taken by him to mean that she was egging him on.
http://fjordman.blogspot.com/2005/08/rape-nothing-to-do-with-...
1 Answer

William James

10/29/2015 9:58:00 PM

0

WJ wrote:

> > Or how about an iteration example using only standard features:
> >
> > (let ((list '(("Joe" 23 "Mechanic")
> > ("Amy" 41 "Executive")
> > ("Bob" 31 "Programmer"))))
> > (loop for (name age occupation)
> > in list
> > do (format t "name: ~a, age: ~a, occupation ~a~%"
> > name age occupation)))
> >
> > Output:
> >
> > name: Joe, age: 23, occupation Mechanic
> > name: Amy, age: 41, occupation Executive
> > name: Bob, age: 31, occupation Programmer
>
> Gauche Scheme:
>
> (let1 men '(("Sepp" 23 "Mechanic")
> ("Dolf" 41 "Executive")
> ("Ivan" 31 "Programmer"))
> (for-each
> (pa$ apply format #t "name: ~a, age: ~a, occupation ~a~%")
> men))
>
> ===>
> name: Sepp, age: 23, occupation Mechanic
> name: Dolf, age: 41, occupation Executive
> name: Ivan, age: 31, occupation Programmer

MatzLisp (Ruby):

"We don't need no stinkin' loops!"

puts [["Sepp",23,"Mechanic"], ["Dolf",41,"Executive"],
["Ivan",31,"Programmer"]].map{|x|
%w(name age occupation).zip(x).map{|x| x.join ': '}.join ' '}

name: Sepp age: 23 occupation: Mechanic
name: Dolf age: 41 occupation: Executive
name: Ivan age: 31 occupation: Programmer

--
Viewed at its most abstract level, a fundamental agenda is thus to influence
the European-derived peoples of the United States to view concern about their
own demographic and cultural eclipse as irrational and as an indication of
psychopathology. --- Dr. Kevin MacDonald; "The Frankfurt School of Social
Research and the Pathologization of Gentile Group Allegiances"