This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-27
Channels
- # bangalore-clj (2)
- # beginners (41)
- # cider (14)
- # cljs-dev (12)
- # cljsrn (2)
- # clojure (106)
- # clojure-austin (6)
- # clojure-dev (22)
- # clojure-dusseldorf (1)
- # clojure-france (1)
- # clojure-greece (17)
- # clojure-italy (6)
- # clojure-poland (3)
- # clojure-russia (10)
- # clojure-serbia (5)
- # clojure-spec (24)
- # clojure-uk (100)
- # clojurescript (126)
- # cursive (3)
- # data-science (5)
- # datascript (15)
- # datomic (3)
- # defnpodcast (2)
- # dirac (6)
- # emacs (10)
- # fulcro (121)
- # graphql (30)
- # hoplon (7)
- # jobs (2)
- # leiningen (20)
- # off-topic (14)
- # onyx (3)
- # other-languages (13)
- # pedestal (1)
- # perun (2)
- # planck (41)
- # re-frame (16)
- # reagent (6)
- # reitit (5)
- # remote-jobs (3)
- # ring (1)
- # ring-swagger (17)
- # shadow-cljs (137)
- # spacemacs (6)
- # sql (4)
- # uncomplicate (7)
- # unrepl (56)
- # vim (27)
anybody ever use this? https://clojuredocs.org/clojure.core/memoize
I used it to solve this codewars problem https://www.codewars.com/kata/john-and-ann-sign-up-for-codewars/train/clojure
since ann's number is based off of john's number and john's number is based off of ann's number I memoized those functions so that the recursion wouldn't blow up the jvm
especially since part of the challenge was summing all the katas done by a certain day which meant calculating the number of katas for each day first and the way I implemented it meant that to get the list of katas for days 1 to 100 meant that I had to get the number for ann and john for 0 then 1 and 0 then 2,1,0 and 3,1,0 all the way to 100,99,98,97...0 so you could see how this would get very expensive without cacheing
cool 🙂