Arc Forumnew | comments | leaders | submitlogin
5 points by sacado 6097 days ago | link | parent

  (def sufac (n) (let y 1 (for x 1 (+ n 1) (= y (* y (fac n)))) y))
The for syntax is (for x first last), not (for x first (+ last 1)) (unlike python). So you have to write :

  (def sufac (n) (let y 1 (for x 1 n (= y (* y (fac n)))) y))
You've also got another bug (a typo I guess) : it's not (fac n) but (fac x) :

  (def sufac (n) (let y 1 (for x 1 n (= y (* y (fac x)))) y))