2015-01-23から1日間の記事一覧

繰り返し : common lisp

common lispで繰り返し ;;;再帰を使う方法 (defun repeat1(x) (if (< x 0) 'nil (progn (print x) (repeat1 (- x 1))))) (repeat1 10) (defun repeat2(x) (cond ((< x 0)'nil) (t (print x) (repeat2 (- x 1))))) (repeat2 10) ;;loopマクロを使う方法 (loop…