Isoraqathedh

Two Suspiciously Similar Functions

Feb 1st, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.78 KB | None | 0 0
  1. (defun get-Chinese-zodiac ()    
  2.   (format t "~&Please type in your Chinese zodiac affiliation: ")
  3.   (let ((input-Chinese-zodiac (read)))
  4.        (cond ((member input-Chinese-zodiac *chinese-zodiac-names*) input-Chinese-zodiac) ; Success
  5.              (t
  6.                (format t "~&Error: ~S not in the list of Chinese zodiacs. Please try again: ")
  7.                (get-Chinese-zodiac)))))
  8.  
  9. (defun get-Western-zodiac ()    
  10.   (format t "~&Please type in your Western zodiac affiliation: ")
  11.   (let ((input-Western-zodiac (read)))
  12.        (cond ((member input-Western-zodiac *western-zodiac-names*) input-Western-zodiac) ; Success
  13.              (t
  14.                (format t "~&Error: ~S not in the list of Western zodiacs. Please try again: ")
  15.                (get-Western-zodiac)))))
Advertisement
Add Comment
Please, Sign In to add comment