ç¶ç¶æ¸¡ãå½¢å¼ éä¹factããå§ãã¾ãããã ;; éä¹ã®æ®éã®å®ç¾© (define (fact n) (if (= n 0) 1 (* n (fact (- n 1))))) ä¸è¨ã®éä¹factã®å®ç¾©ã¯ å¼æ°nã0ãªã1ãè¿ã(åºåºæ¡ä»¶) ãã以å¤ãªãn-1ã®éä¹ã«nãæãããã®ãè¿ã(å帰æ¡ä»¶) ã¨ãªã£ã¦ãã¾ãã ãããfactããç´æ¥å¤ãè¿ãã®ã§ã¯ãªãã è¿ãã¹ãå¤ãç¶ç¶æç¶ãã¨å¼ã°ãããã®ã«æ¸¡ãã¾ãã ç¶ç¶æç¶ãèªä½ã¯ç¹å¥ãªé¢æ°ã§ã¯ããã¾ããã åã«ãæ¬æ¥è¿ãå¤ãè¿ãã¨ããã§ããã®æç¶ãã«ããã¨ã¯ããããã㨠æ®ãã®å¦çãå§ãã¦ãã¾ãã¾ãã ãããã使ãæ¹ããããæç¶ãã®ãã¨ã§ãã ;; ç¶ç¶æ¸¡ãå½¢å¼ã®éä¹ã®å®ç¾© (define (fact/cps n cont) (if (= n 0) (cont 1) (fact/cps (- n 1) (lambda (a) (cont (
{{#tags}}- {{label}}
{{/tags}}