Lisp@UNIX版at UNIX
Lisp@UNIX版 - 暇つぶし2ch333:名無しさん@お腹いっぱい。
03/07/03 10:56.net
>>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)))))



次ページ
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch