A long time ago, I wrote this simple heap implementation:

https://gist.github.com/4158634

There are a lot of rough edges here. Many of them could be cleaned up (ie, 
replaced with standard library functions) if I could rely on the contents 
of the heap being trivially comparable using < and > methods. However, I'd 
like to be able to put complex data types into my heap, so I need to be 
able to supply comparison logic, potentially even for functions (like 
min-key) that don't allow me to explicitly provide one.

I have the sense that this sort of thing is possible using deftype, 
defrecord, multimethods, or protocols, but I'm having a hard time figuring 
out where to start my education on these topics - there's a lot to know 
about all of this stuff.

Can anyone suggest a place where I can get started?

Thanks!

Mark

-- 
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

Reply via email to