; Can you rewrite your function to map it to a list?
; ------------------------------
; The Little Lisper 3rd Edition
; Chapter 9
; Exercise 1
; Common Lisp
; http://t...content-available-to-author-only...r.com/thelittlelisper
; http://t...content-available-to-author-only...t.com/2010/06/little-lisper-chapter-9-lamdba-ultimate.html
; http://t...content-available-to-author-only...t.com/2010/06/little-lisper.html
; ------------------------------
(defun map_ (l func)
(cond
((null l) NIL)
(t (cons (funcall func (car l))
(map_ (cdr l) func)))))
;firsts
(print (map_ '((paella spanish)(wine red)(and beans)) #'car))
;(PAELLA WINE AND)
(setf spanish-food '((paella spanish)(wine red)(and beans)))
(print (map_ spanish-food #'car))
;(PAELLA WINE AND)
;seconds
(defun seconds-closure (l)
(car (cdr l)))
(print (map_ spanish-food #'seconds-closure))
;(SPANISH RED BEANS)
OyBDYW4geW91IHJld3JpdGUgeW91ciBmdW5jdGlvbiB0byBtYXAgaXQgdG8gYSBsaXN0Pwo7IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQo7IFRoZSBMaXR0bGUgTGlzcGVyIDNyZCBFZGl0aW9uCjsgQ2hhcHRlciA5CjsgRXhlcmNpc2UgMQo7IENvbW1vbiBMaXNwCjsgaHR0cDovL3QuLi5jb250ZW50LWF2YWlsYWJsZS10by1hdXRob3Itb25seS4uLnIuY29tL3RoZWxpdHRsZWxpc3Blcgo7IGh0dHA6Ly90Li4uY29udGVudC1hdmFpbGFibGUtdG8tYXV0aG9yLW9ubHkuLi50LmNvbS8yMDEwLzA2L2xpdHRsZS1saXNwZXItY2hhcHRlci05LWxhbWRiYS11bHRpbWF0ZS5odG1sCjsgaHR0cDovL3QuLi5jb250ZW50LWF2YWlsYWJsZS10by1hdXRob3Itb25seS4uLnQuY29tLzIwMTAvMDYvbGl0dGxlLWxpc3Blci5odG1sCjsgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCgooZGVmdW4gbWFwXyAobCBmdW5jKQogIChjb25kCiAgICgobnVsbCBsKSBOSUwp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