when I wrote a tag out, I did the same as Justin in his ordered lib,
(defmethod print-method OrderedSet [o ^java.io.Writer w]
(.write w "#ordered/set ")
(print-method (seq o) w))
so the tag is defined by this library and has specific meaning in the data
written by this lib. A matched reader is a probably a good idea.
This definition of print-method already causes possible conflict or loss of
information it another lib uses the same tag. Library writers need to be
aware of this and namespace appropriately.
Alternatively, library writers must not implement print methods or must
implement them in a way that can use an end-application developer defined
tag.
I suppose that there is no reason why you could not read the tag above into
a different type or implementation as long as you understood and honoured
the semantics intended. In this sense, the tag is not dissimilar to a named
contract (or interface).
The more common case would probably be to re-read what had been written.
Perhaps this should be the default. With an option to change if you really
wanted to.
I wasn't aware of the namespace possibility so the idea of "library tags"
does not seem unreasonable.
Dave
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en