On Fri, Jun 29, 2012 at 4:50 PM, David Nolen <dnolen.li...@gmail.com> wrote:
> ISeq *is* an interface on Clojure JVM. But ideally it would be > protocol as in ClojureScript. But then all ISeq implementing types > must also implement this new protocol you are suggesting to get these > basic *generic* sequence operations we enjoy today. > > I see, you're not saying it can't be done in Clojure, you're saying it wouldn't work on ClojureScript. It seems to me that's a limitation of either ClojureScript, or protocols, or both. My guess is that it's a limitation of ClojureScript, because my understanding is that in Clojure, every protocol generates a Java interface, so I can't think of any reason why you couldn't list that generated interface as a "type" in another protocol (although I haven't tried it). If that doesn't work, then this merits more discussion, I think, because it points to a real issue about building large systems with protocols. The issue of "thin" vs "fat" interfaces is a tricky one in many languages, and one of the most reasonable solutions is to give the fat interface an implementation in terms of the thin one, so that implementers are only required to implement the thin interface, but can override the default implementation of the fat interface if need be. If this can't be done in Clojure, it would be good to figure out an alternative that will work. -- 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