We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9304858 commit 3990c95Copy full SHA for 3990c95
src/little-schemer/y-combinator.js
@@ -13,6 +13,8 @@ var fib = Y(function (fib_t) {
13
return function (n) {
14
if (n == 0) return 0;
15
if (n == 1) return 1;
16
- return fib_t(n-1) + fib_t(n-2);
+ return fib(n-1) + fib(n-2);
17
};
18
});
19
+
20
+console.log(fib(10));
src/little-schemer/y-combinator.scm
@@ -253,10 +253,10 @@
253
; we define the part that is not related to length/mk-length as Y
254
; that is y-combinator
255
(define Y
256
- (lambda (le)
+ (lambda (g)
257
((lambda (f) (f f))
258
(lambda (f)
259
- (le (lambda (x) ((f f) x)))))))
+ (g (lambda (x) ((f f) x)))))))
260
261
(define mk-length
262
(lambda (length)
0 commit comments