This issue from David Nolen, caught my eye:
https://github.com/andrewmcveigh/cljs-time/issues/21

Feels like there is important information there, but I just don't know enough 
to interpret what's said. Can anyone help?

If I have this:

(def x  {:a 1 :b 2})

David is saying that x can't be dead-code-eliminated. Correct?

If so, the solution he talks about is?

;; Replacing PersistentHashMaps with functions?  Can't be right. I think I'm 
being too literal here
(def  x  ((fn []  {:a 1 :b2})))

;; more likely this? 

(defn x
  [] 
  {:a 1 :b 2})

Ie. you must now "call" x to get the map.  

If this solution is the right one, doesn't that mean we would be inefficiently 
constructing the (potentially large) hashmap inside x on each call. 

--
Mike


-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to