Ken Wesson <kwess...@gmail.com> writes:

Hi Ken,

>> does clojure have sets that keep the insertion order, like Java's
>> LinkedHashSet?
>
> Try something like:
>
> (deftype OrderPreservingSet [v m s]
> [...]

Great, I'll try that tomorrow.

> It should be substitutable for a normal set in Clojure code, but it
> seqs and prints itself in insertion order.  Performance caveat: if you
> keep conjing and disjing items from an open-ended set the internal
> vector may keep growing.

I'm doing a graph querying DSL with clojure.  I need the ordered sets
there, and I only need fast insertion and membership test, but I will
never disjoin elements.

Bye,
Tassilo

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