2013/5/13 Meikel Brandmeyer (kotarak) <m...@kotka.de>

>
> You misunderstood my argument. cycle returns a sequence => use seq. count
> is the wrong thing to call here. And calling seq without using its return
> value (with a name) is a smell. count should not be called in sequences.
> (In fact I believe that count should be O(1).)
>

Ok, I see the point you're trying to get at. Though I'm
not entirely convinced, that seqs and data structures should be that much
bifurcated. After all seqs _are_ data structures + possible laziness.

I agree that seq should only be called if the result is used as a sequence,
but I also do think it's OK to call collection/data-structure functions on
seqs. There are even optimizations for that:
e.g. (count (seq [1 2 3])) is O(1):
https://github.com/clojure/clojure/blob/1428d43c9a5f9d0e7e89a55707868df76c69d549/src/jvm/clojure/lang/APersistentVector.java#L444

-- 
-- 
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/groups/opt_out.


Reply via email to