Is there any reason why "last" needs to be slow on vectors? Can it just do 
the right thing and be fast on it?

On Thursday, June 28, 2012 4:28:30 PM UTC-4, Meikel Brandmeyer (kotarak) 
wrote:
>
> Hi, 
>
> Am 28.06.2012 um 20:52 schrieb Tassilo Horn: 
>
> > And yes, there are some counter examples like `count` and `last`... 
>
> last is not a counterexample. last is a sequence function, which acts on 
> seqs. It just calls seq on its argument so you may pass in a vector (or 
> anything seqable). The vector equivalent of last is peek, btw. 
>
> nth is better example, since it's fast on vectors and O(n) on seqs and 
> lists. Just like count. 
>
> Kind regards 
> Meikel 
>
>

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