| I don't understand what this one is.

I think I might be wishing specs were also types. In my head, I see as say, if 
I spec a vector as ::cart-items, I'd like to implement a protocol for 
::cart-items which will dispatch to the function handling ::cart-items, and if 
that didn't exist, it would go back to dispatching on the Java type.

I'm pretty sure this wouldn't be possible, because objects don't know what spec 
they belong too, so it couldn't be implemented. But, I thought at least for 
tagged maps, where one key of the map is a pseudo-type, and a multi-spec, where 
the spec defines which key contains the tag info, maybe if you extended the 
multi-spec with a protocol somehow protocols could be made to dispatch on the 
tag.

As I write this, I feel more and more like this isn't possible, since again, at 
runtime, nothing is known of the associated spec. But I thought I'd still ask.

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to