Using MATCH to Parse Input
(load "MATCH.CL")
(defun get-favorite-color ()
(let*
((ans (get-input-as-list
"What is your favorite color?") )
(result
(or
(match '((? c)) ans)
(match '(its (? c)) ans)
(match '((? c) is my (* x)) ans)
(match '(my (* x) is (? c)) ans)
) ) )
(if result (val 'c result) 'unknown) ) )
Previous slide
Next slide
Back to first slide
View graphic version