On 21 March 2010 20:10, Mark Engelberg <mark.engelb...@gmail.com> wrote:
> I have tried things like:
> (defmethod clojure.core/print-method ::Piece [piece writer] (do (pr (:number
> piece) writer) (pr (:letter piece) writer)))
> but it doesn't work.

You need to replace pr with print-method inside the do. pr doesn't
accept the writer argument.

That'll only take are of printing, though; I'm not sure if there is a
way to override .toString on a deftype, since I believe that's a
method of the Object class and not an interface/protocol... :-(

All the best,
Michał

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