; Get the variables passed into your expression DSL
; ------------------------------
; The Little Lisper 3rd Edition
; Chapter 7
; Exercise 8
; 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-7-shadows.html
; http://t...content-available-to-author-only...t.com/2010/06/little-lisper.html
; ------------------------------
(setf l1 '())
(setf l2 '(3 + (66 6)))
(setf aexp4 5)
; ------------------------------
(defun lookup (a lat)
(cond
((null a) NIL)
((null lat) NIL)
((eq a (car (car lat)))
(cdr (car lat)))
(t
(lookup a (cdr lat)))))
(print (lookup 'y '((x 1)(y 0))))
;0
(print (lookup 'x '((x 1)(y 0))))
;1
(print (lookup 'u '((u 1)(v 1))))
;1
(print (lookup 'y '()))
;NIL no answer
OyBHZXQgdGhlIHZhcmlhYmxlcyBwYXNzZWQgaW50byB5b3VyIGV4cHJlc3Npb24gRFNMCjsgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCjsgVGhlIExpdHRsZSBMaXNwZXIgM3JkIEVkaXRpb24KOyBDaGFwdGVyIDcKOyBFeGVyY2lzZSA4CjsgQ29tbW9uIExpc3AKOyBodHRwOi8vdC4uLmNvbnRlbnQtYXZhaWxhYmxlLXRvLWF1dGhvci1vbmx5Li4uci5jb20vdGhlbGl0dGxlbGlzcGVyCjsgaHR0cDovL3QuLi5jb250ZW50LWF2YWlsYWJsZS10by1hdXRob3Itb25seS4uLnQuY29tLzIwMTAvMDYvbGl0dGxlLWxpc3Blci1jaGFwdGVyLTctc2hhZG93cy5odG1sCjsgaHR0cDovL3QuLi5jb250ZW50LWF2YWlsYWJsZS10by1hdXRob3Itb25seS4uLnQuY29tLzIwMTAvMDYvbGl0dGxlLWxpc3Blci5odG1sCjsgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCihzZXRmIGwxICcoKSkKKHNldGYgbDIgJygzICsgKDY2IDYpKSkKKHNldGYgYWV4cDQgNSkKOyAtLS0tLS0tLS0t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