;;; THE INTRO TO AI SHOW ;;; Summer Session I 1997 ;;; ;;; DEMO: ;;; Simple use of dolist ;;; ;;; Selmer Bringsjord ;;; A group of Bringsjords (setf bringsjords '((selmer 38 professor) (conrad 36 investment-banker) (katherine 10 web-surfer) (alexander 7 golfer) (elizabeth 24 psychologist) (olga 62 tycoon))) ;;; The following function is too narrowly defined. Can you change it ;;; so that it searches, e.g., for ages in any location within the ;;; sub-lists? (defun count-younguns (cutoff list) "A narrowly defined function to bring back those yonger than cutoff." (let ((result 0)) (dolist (element list result) (when (< (second element) cutoff) (setf result (+ result 1))))))