CommonLisp初心者スレ
■ このスレッドは過去ログ倉庫に格納されています
0280デフォルトの名無しさん
NGNGおお。できました。ありがとうございます。
(defun my-mapcar (fn list &rest lists)
(if (not list)
nil
(cons (apply fn (car list) (my-mapcar #'car lists))
(apply #'my-mapcar fn (cdr list) (my-mapcar #'cdr lists)))))
(my-mapcar #'1+ '(1 2 3)) => (2 3 4)
(my-mapcar #'+ '(1 2 3) '(4 5 6)) => (5 7 9)
(my-mapcar #'+ '(1 2 3) '(4 5 6) '(7 8 9)) => (12 15 18)
(mapcar #'+ '(1 2 3) '(4 5 6) '(7 8 9)) => (12 15 18)
■ このスレッドは過去ログ倉庫に格納されています