On Dec 6, 2010, at 9:02 PM, Ken Wesson wrote:

> I'll try this one more time. You suggested the innards, and with them
> the seq order of the elements, might get rearranged.

I suggested no such thing; perhaps you are confusing me with Mike Meyer? I 
referred more generally to the possibility of two different calls to (seq) on 
the same collection returning the items in different orders. This might happen 
if e.g. the underlying collection picks a starting point for the iterators it 
returns non-deterministically. I'm not saying this is likely to be done in 
practice, mind you, just that there are conceivable cases where an immutable 
collection would not want to provide that kind of ordering guarantee.

>> It's not just about (nth) giving consistent results. It's also about forcing 
>> the programmer to make his intentions explicit, per Rich's quote.
> 
> We may just have to agree to disagree about that. It seems to me that
> calling nth, or first, or seq, or anything like that makes the
> programmer's intentions explicit, as those are all clearly treating
> the structure as a sequence. It's calling (foo coll) where foo calls
> (nth (seq coll)) or somesuch under the hood that doesn't make the
> programmer's intentions (as) explicit; they're calling some function
> on, say, a map and it may not be especially obvious that that function
> treats the map (and anything else passed to it) as a sequence.
> 
> Anyway, you can't legislate code clarity at the language level. They
> tried that with Java and look where it got them. Annotations,
> generics, and checked exceptions, oh my!

I don't actually have a strong opinion one way or the other on this, though I 
can see how it would appear otherwise from what I wrote. I was just giving what 
I understood to be one of the "official" reasons for the decision.

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