- 333 名前:名無しさん@お腹いっぱい。 mailto:sage [03/07/03 10:56]
- >>331 見た感じ elisp だな.
(defun my-test2 (lst1 lst2) (my-test2-aux lst1 lst2 nil)) (defun my-test2-aux (lst1 lst2 acc) (if (null lst1) (nreverse acc) (my-test2-aux (cdr lst1) lst2 (my-test2-aux2 (car lst1) lst2 acc)))) (defun my-test2-aux2 (e lst acc) (if (null lst) acc (my-test2-aux2 e (cdr lst) (cons (concat e (car lst)) acc)))) ↓どう考えてもこっちのが効率的だとおもうが,なんで再帰でやりたいんだ?? (defun my-test3 (lst1 lst2) (let (acc) (dolist (e1 lst1 (nreverse acc)) (dolist (e2 lst2) (push (concat e1 e2) acc)))))
|

|