Lisp Scheme Part19
レス数が950を超えています。1000を超えると書き込みができなくなります。
0987デフォルトの名無しさん
2008/03/10(月) 20:36:49Little Lisper には演習問題があるのでひとつ紹介しよう。
演習9.4:
With the Y-combinator we can reduce the number of arguments on which a function has to recur.
For example, member can be rewritten as:
(define member-Y
(lambda (a l)
((Y (lambda (recfun)
(lambda (l)
(cond
((null? l) nil)
(t (or
(eq? (car l) a)
(recfun (cdr l))))))))
l)))
Step through the application (member-Y a l) where a is x and l is (y x).
Rewrite the functions rember, insertR, and subst2 in a similar mannar.
レス数が950を超えています。1000を超えると書き込みができなくなります。