Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Use Java! Was: becoming a better programmer

18 views
Skip to first unread message

Robert L.

unread,
Mar 12, 2018, 7:38:13 AM3/12/18
to
> 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

(for-each
(curry apply printf "name: ~a, age: ~a, occupation: ~a~%")
'(("Sepp" 23 "Mechanic")
("Dolf" 41 "Executive")
("Ivan" 31 "Programmer")))

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

--
Africans gang-rape and clitorectomize Finnish girl; government arrests Finn
whom they accuse of complaining. http://archive.org/details/nolies
0 new messages