Hi Ritchie
You appear to be using the transient as a mutable object, which is not correct in the general case. You should only use the return value of assoc!/dissoc!/et cetera. lvh > On Nov 10, 2015, at 1:03 PM, Ritchie Cai <ritchie...@gmail.com> wrote: > > btw, I'm using Java 1.8.0_60-b27, Clojure 1.7.0 > > On Tuesday, November 10, 2015 at 12:59:54 PM UTC-6, Ritchie Cai wrote: > Hi, > > I'm wondering if anyone can help me understand why transient map in my code > stops adding entries. > Here is my implementation of huffman code generation given a string: > > https://gist.github.com/malloc82/efeec1053b9af195e351#file-huffman-clj-L53-L55 > > <https://gist.github.com/malloc82/efeec1053b9af195e351#file-huffman-clj-L53-L55> > > Line 53-55 is where it adds a huffman code entry into a transient map. If you > run the test on line 61, you can see from print out and return value that no > new entry is added after adding 8 entries, i.e. after \A. No sure why. > > Thanks > Ritchie > > > -- > 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 > <http://groups.google.com/group/clojure?hl=en> > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com > <mailto:clojure+unsubscr...@googlegroups.com>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.