2012-07-18から1日間の記事一覧

演習1.4

リスト中に特定のアトムが含まれる数を数える関数を作る。 (defun count-anywhere (x lst) (cond ((null lst) 0) ((listp (first lst)) (+ (count-anywhere x (first lst)) (count-anywhere x (rest lst)))) (t (+ (if (eq x (first lst)) 1 0) (count-anywh…