Hi,

On Sun, Mar 21, 2010 at 08:43:10PM +0100, Michał Marczyk wrote:

> But how would one go about that? str calls .toString on its arguments,
> which is in turn a method of Object, thus not present in any
> interface, whereas deftype / extend only allow one to implement
> interface or protocol methods...

user=> (deftype Xyz []
  Object
  (toString
    []
    "This is a Xyz!"))
#'user/Xyz
user=> (str (Xyz))
"This is a Xyz!"

The docstring of deftype says protocol, interface or Object.

Sincerely
Meikel

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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to