> Alternatively, records could have an enforced mapping {:type
> TheRecordsClass} that does not actually take up storage space, but
> appears when records are queried and automatically imposes the desired
> equality semantics if records were simply treated as maps -- other
> than that a plain map with the same type key-value pair could now
> compare equal to the record. (Would that be a bad thing though?)

That might be the clearest way to allow records to behave as Java
Maps, while preserving type-based equality.  It's how I did things
manually to keep struct-maps straight, before there were records.

The more I think about the current behavior, the less I think I like
it.  If P and Q have different implementations of the same protocol,
you can have (.equals (P.) (Q.)) but completely different semantics
for (foo (P.)) and (foo (Q.)).

In any case, I've posted a ticket for the docstring fix:
http://dev.clojure.org/jira/browse/CLJ-736

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