S SnoopCat Senior member Jan 19, 2001 926 0 0 May 23, 2001 #1 (define fact (lambda (x) (cond ( ( = x 0 ) 1 ) ( else ( * x ( fact x - 1 ) ) ) ) ) ) => (fact 3) i get an error..... anyone see the bug? its for factorials
(define fact (lambda (x) (cond ( ( = x 0 ) 1 ) ( else ( * x ( fact x - 1 ) ) ) ) ) ) => (fact 3) i get an error..... anyone see the bug? its for factorials
Platypus Lifer Apr 26, 2001 31,046 321 136 May 23, 2001 #2 (define fact (lambda (x)) (cond ( ( = x 0 ) 1 ) ( else ( * x ( fact x - 1 ) ) ) ) ) ) => (fact 3) try that..
(define fact (lambda (x)) (cond ( ( = x 0 ) 1 ) ( else ( * x ( fact x - 1 ) ) ) ) ) ) => (fact 3) try that..
S SnoopCat Senior member Jan 19, 2001 926 0 0 May 23, 2001 #5 procedure fact: expects 1 argument, given 3: 3 - 1
X Xede Senior member Oct 15, 1999 420 0 0 May 23, 2001 #6 Try replacing (fact x - 1) with (fact (- x 1)) or something like that...