Where is the sense in memoizing a function with no arguments? It must be free of side effects, or memoize would break. And if it's free of side effects, why not just (def mymap {...}) ?
On Tue, Jun 19, 2012 at 2:03 PM, Jim - FooBar(); <jimpil1...@gmail.com> wrote: > Is there a catch to this that I'm not seeing? It seems to work just > fine...after all the fn always returns the same thing (which always has the > same values in)... > > Jim > > > > On 19/06/12 12:57, Jim - FooBar(); wrote: >> >> This is really impressive!!! From 61ms it went down to 0.8ms !!! doing >> this is way faster than records I think...and since the fn I memoized takes >> no args it can't be cached more than once yes? >> >> Jim >> >> ps: my second question can be considered reduntant...I meant to say that >> some of the keys in the map point to function calls (they don't return >> functions) so they can't be memoized...by the time the map is returned >> everything inside is a value... >> >> On 19/06/12 12:46, Jim - FooBar(); wrote: >>> >>> Ok we've established that accessing records fields is much faster than >>> using regular maps...what will happen though if we create a memoized fn that >>> simply returns the map? will records still be faster? also if some of they >>> keys in the map point to other functions do they need to be memoized as >>> well? >>> >>> Jim >> >> > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- Moritz Ulrich -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en