On Jan 18, 2013 2:36 PM, "Ben Wolfson" <wolf...@gmail.com> wrote:
> >> I could just extend ILookup, which contains only valAt, but I'd also
> >> like to be able to implement containsKey and entryAt, which AFAICT are
> >> only found in Associative.

Associative also contains

Associative assoc(Object key, Object val);

I would propose, as a law, that anAssociative.assoc(k, v).valAt(k) = v.  Do
you satisfy that?  (An enumeration of Associative laws would be helpful
here.)

Anyway, anyone is free to assume that, given an IPersistentMap (or what
have you), all of the laws of its superclasses are also implied.  So I
think inheriting Seqable is a positive statement of this law:

anAssociative.entryAt(k) returning entry E,
implies that (seq anAssociative) contains E.

But I cannot be sure.  Without this law, though, you are basically left
with (pure) function.

--
Stephen Compall
If anyone in the MSA is online, you should watch this flythrough.

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