According to the code you need to implement an IPersistentCollection
and Seqable
You can browse or download the code:
http://github.com/richhickey/clojure/tree/master
look in src/clj/clojure/core.clj
for the definition of conj etc, which you can see call methods on
RT.java which is in
src/jvm/clojure/lang/RT.java
which in turn calls IPersistentCollection methods.

eg:
(def my-col
  (proxy [clojure.lang.IPersistentCollection] []
    (seq nil)
    (count [] 5)
    (cons [obj] nil)
    (empty [] true)
    (equiv [obj] true)))
user=> (count my-col)
0
user=> (conj my-col 5)
nil



On Aug 31, 9:35 am, "jonathan.arrender.sm...@gmail.com"
<jonathan.arrender.sm...@gmail.com> wrote:
> I was not sure from the documentation if conj, seq, etc are generic
> functions (multimetiod functions). Is there any easy way to defines
> these for a new type?
>
> Thanks!
> Jonathan
--~--~---------~--~----~------------~-------~--~----~
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