Lisp Scheme Part19
レス数が950を超えています。1000を超えると書き込みができなくなります。
0990デフォルトの名無しさん
2008/03/10(月) 21:10:32In the chapter we have derived a Y-combinator that allows us to write recursive functions of one argument without using define.
Here is the Y-combinator for functions of two arguments:
(define Y2
(lambda (M)
((lambda (future)
(M (lambda (arg1 arg2)
((future future) arg1 arg2))))
(lambda (future)
(M (lambda (arg1 arg2)
((future future) arg1 arg2)))))))
Write the functions =, rempick, and pick using Y2.
Note: There is a version of (lambda ...) for defining a function of an arbitrary number of arguments, and an apply function for applying such a function to a list of arguments.
With this you can write a single Y-combinator for all functions.
レス数が950を超えています。1000を超えると書き込みができなくなります。