ä¸åç¹ãªãã¬ã¼ã¿Y éä¹é¢æ°ã¯ã (define fact (lambda (n) (if (= n 0) 1 (* n (fact (- n 1)))))) ã®ããã«ãå帰çã«å®ç¾©ã§ããã å帰çå®ç¾©ãè¡ãªãå ´åã¯defineãletrecã使ããã©ã 代ããã«letã使ãã¨å帰çå®ç¾©ã¯ã§ããªãã defineãletrecãã©ããã¦ã使ããããªããªããå¤å°å·¥å¤«ãããã ä¾ãã°ãfactã®å¼æ°ãå¢ããã¨ããæ¹æ³ãããã (let ((fact (lambda (self n) (if (= n 0) 1 (* n (self self (- n 1))))))) (fact fact 10)) â 3628800 (ä¸ç¥) ä¸åç¹ãªãã¬ã¼ã¿Yã使ãã¨æ¬¡ã®ããã«æ¸ããã (let* ((Y (lambda (g) ((lambda (s) (g (lambda (x) ((s s) x))
{{#tags}}- {{label}}
{{/tags}}