On Dec 14, 5:48 am, Mark Tomko <mjt0...@gmail.com> wrote:
> I wrote this implementation of a heap (or priority queue) in pure
> Clojure:
>
> http://pastebin.com/m2ab1ad5a
>
> It's probably not of any quality sufficient to be make it to the
> contrib package, but it seems to work.  Any thoughts on how it might
> be improved?
>
> Thanks,
> Mark

Ideally such a collection would be usable with existing functions,
e.g. pop, peek.  To accomplish that you really need to implement
against the expected java interfaces.

I've been playing with the deftype/defprotocol stuff in the "new"
branch, so I figured I'd try to apply that to this problem.  This is
what I came up with:

http://gist.github.com/256815

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