Re: Override print-method of struct

2010-10-14 Thread sune.simonsen
Maybe you could use a parent map. You have a normal tree, and then you have a map where you can get the parent for a given node. I don't know if this will be too slow for your problem - it's just an idea. Kind regards Sune On Oct 13, 6:45 pm, andrei wrote: > How can I override print-method for a

Re: Speeding up equals using the cached hash code?

2010-08-05 Thread sune.simonsen
Thanks for all the answers. It is a little bit embarrassing, but Paul Stadig seems to be totally right, it is already implemented. I don't know how I could have overlooked that - sorry. I guess it is not that bad of an idea after all then ;-) I'll be a little more thorough next time I post. Kind

Speeding up equals using the cached hash code?

2010-08-04 Thread sune.simonsen
I was looking around the Clojure source code and noticed that the persistent immutable collections caches their hash codes. The java doc says the following about the equals method: (http:// download.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html) "If two objects are equal according to the