• 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

    Understanding Clojure reduce better

    less than 1 minute read

    Parsing GraphQL with Clojure

    less than 1 minute read

    Three personal software products I created with Clojure

    less than 1 minute read

    factorial in Clojure. Using memonize. Numeric Data Types.

    less than 1 minute read

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