Depends on what you mean by that. If you mean, create a hashset for
use in clojure that will only accept MyType objects, I'll defer to
someone here who knows more clojure than I do, though it looks like
metadata preconditions are the way to go.

If you mean, create a hashset you can pass to Java objects and it will
(a) accept only MyType objects, and (b) not require casting when
getting elements out of it: it's not possible. Java's generics are a
source-level convenience, and a HashSet<E> won't contain any reference
to the E with which it was constructed.

On Aug 10, 1:06 pm, Tim Daly <d...@axiom-developer.org> wrote:
> How do I construct
>   Set<MyType> s = new HashSet();
> in clojure?

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