On Fri, Jun 29, 2012 at 4:50 PM, David Nolen <dnolen.li...@gmail.com> wrote:

> On Fri, Jun 29, 2012 at 7:28 PM, Sam Ritchie <sritchi...@gmail.com> wrote:
> > Perhaps place them inside a protocol, where core supplies implementations
> > for ISeq only? This would make it easier to extend efficient behavior to
> > other types without placing a big burden on core.
>
> 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 think the suggestion is to create a protocol for each function that could
potentially gain speed improvements for specialized types.  So for example,
ILast could be a protocol.  extend ILast to have an implementation for ISeq
(using the current code).  Then, there's no burden on implementers of new
data types that implement ISeq to do any additional work, but those who
want to create custom implementations of last for other data types are free
to do so.  Win-win.

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