Cons.FromXXX inconsistency

0 views
Skip to first unread message

Graven

unread,
Jan 23, 2007, 10:52:17 AM1/23/07
to LSharp
Hello guys,

I'm just started playing with L#; my project involves passing a
String[] to the interpreter. I'm forced to use Cons.FromArray or
Cons.FromICollection in this case, and I've figured out that those
functions return different results -- FromArray provides a valid Cons,
while FromICollection reverses it.

I can't understand, if it's a bug or it has some deeper meaning -- can
anyone clarify that?

Thanks!

rayc...@gmail.com

unread,
Jan 23, 2007, 12:30:47 PM1/23/07
to LSharp

Well, FromICollection returns a valid Cons too, its just that the list
elements aren't in the order you're expecting.

ICollection implies an unordered collection; in fact, there is no
enumerator for it, so you shouldn't expect the objects in an
ICollection to be in any specific order.

rayc...@gmail.com

unread,
Jan 23, 2007, 12:41:35 PM1/23/07
to LSharp
Ack! what I meant to say is that there's no indexer for ICollection ...
of course it has an enumerator.

Reply all
Reply to author
Forward
0 new messages