Clojureã®ä»ã«ããã¨ã Clojure 1.3 ããããªããã£ãåã«ããå注éãå¯è½ã«ãªã£ãããã§ããããªããã£ã åã«ããå注éã¯ãæé©åã«ããã¦æãéè¦ãªæ å ±ã®ä¸ã¤ã§ããããå½ç¶ãªã ããã®çµæã¨ãã¦ãããªããã£ããªæ¼ç®ãä¼´ãå¦çã®é«éåãæå¾ ã§ãããã ã§ããã¹ã©ã¤ãã§ã¯ã以ä¸ã® fib é¢æ°ãä¾ã«ã¨ã£ã¦ãå注éãä¸ããå ´å㨠ä¸ããªãã£ãå ´åã¨ã§ãã©ãã ãå®è¡é度ãéããã示ãã¦ãã¾ãã ;; å注éãªã (defn fib [n] (if (<= n 1) 1 (+ (fib (dec n)) (fib (- n 2))))) (time (fib 38)) ;=> Elapsed time: 4100.272 msecs ;; å注éãã (defn fib ^long [^long n] (if (<= n 1) 1 (+ (fib (dec n)) (fib (- n
{{#tags}}- {{label}}
{{/tags}}