• Skip to primary navigation
  • Skip to content
  • Skip to footer
Clojure Diary Clojure Diary
  • Book
  • Code
  • Videos
  • Donate
    Karthikeyan A K

    Karthikeyan A K

    Hello, I am Karthikeyan A K, a software architect, and these writings are my experiments with Clojure. Contact me @ +91 8428050777 for Clojure consulation in weekends.

    • Email

    Fibonacci properly memoized in Clojure

    less than 1 minute read

    Notes

    ;; memonize_fib_right_way.clj
    
    (def fib (memoize
              (fn [index]
                (case index
                  1 0
                  2 1
                  (+
                   (fib (dec index))
                   (fib (- index 2)))))))
    (fib 52)
    
    • Reddit Comments

    Updated: October 5, 2022

    Twitter Facebook LinkedIn
    Previous Next

    You May Also Enjoy

    Wrote about Java integration, and private functions in Clojure Book

    less than 1 minute read

    REPL Driven Test After Development

    less than 1 minute read

    Automatic Type Conversion in Clojure

    less than 1 minute read

    Added video links to Clojure Book

    less than 1 minute read

    • Feed
    © 2025 Clojure Diary. Powered by Jekyll & Minimal Mistakes.