03/07/02 21:04.net
なんか、大分さがってるけど質問してみます。
↓この test って関数を append を使わないで再帰で書くにはどうしたらいいですか?
(defun test (list1 list2)
(let (list)
(while list1
(let ((list3 list2))
(while list3
(setq list (cons (concat (car list1) (car list3)) list))
(setq list3 (cdr list3))))
(setq list1 (cdr list1)))
(nreverse list)))
append を使えば↓な感じでいけるんですが。。。
(defun test1 (list1 list2)
(if list1
(append (test2 (car list1) list2)
(test1 (cdr list1) list2))))
(defun test2 (str list)
(if list
(cons (concat str (car list))
(test2 str (cdr list)))))
lisp 初心者に愛の手を。。。