ISeq is a interface on Clojure JVM. So that will work. In ClojureScript it
won't as ISeq is a protocol.

On Friday, June 29, 2012, Mark Engelberg wrote:

> On Fri, Jun 29, 2012 at 5:17 PM, David Nolen 
> <dnolen.li...@gmail.com<javascript:_e({}, 'cvml', 'dnolen.li...@gmail.com');>
> > wrote:
>
>> As I said, if ISeq and ILast are both protocols that won't work. No
>> protocol inheritance.
>>
>>
> I don't see how inheritance factors into this.  This works just fine in
> Clojure 1.3.  What am I missing?:
>
> (defprotocol Last
>   (better-last [s]))
>
> (extend-protocol Last
>   nil
>   (better-last [s] (last s))
>   Object
>   (better-last [s] (last s))
>   clojure.lang.ISeq
>   (better-last [s] (last s))
>   clojure.lang.Reversible
>   (better-last [s] (first (rseq s)))
>   java.lang.String
>   (better-last [s] (nth s (dec (count s))))
>   clojure.lang.IPersistentVector
>   (better-last [s] (peek s)))
>
> --
> 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<javascript:_e({}, 'cvml', 
> '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 <javascript:_e({}, 'cvml',
> 'clojure%2bunsubscr...@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 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