WARNING: You should seriously try to answer this question before looking at the solution -- it's just a good study skill. Also, some answers on this page may be more brief than you would want to put down in an actual exam. If you want any type of partial credit, you should write more than just the solution.
popeye <animal> | spinach <vegetable> | milo <venus-flytrap> |
---|---|---|
name: 'popeye hunger: -1 size: 150 location: 'nowhere |
nutritional-value: 0 size: 100 location: 'grocery-store |
favorite-meals: '(flies) name: 'milo hunger: -1 nutritional-value: 0 size: 100 location: 'nowhere |
(defgeneric (edible? eater eaten)) (defmethod (edible? (eater <thing>) (eaten <thing>)) #f) (defmethod (edible? (eater <animal>) (eaten <vegetable>)) #t) (defmethod (edible? (eater <venus-flytrap>) (eaten <fly>)) #t)