Ignoring the bit about d3 showing as Obj[] in spite of the typing and the cast; I'm thinking that d1 == d2 should be true, not false. Same size, contains equal Int values.
brianTue 5 May 2009
The docs are incorrect - the types of the two lists must match also:
Str[,] != Str?[,]
That can be a gotcha especially in testing for verifyEq, but I definitely think it is the correct behavior (especially for testing).
I will fix the docs.
KevinKelleyTue 5 May 2009
the types of the two lists must match also
Not sure I agree with that; doesn't == usually mean equivalent, as opposed to identical? Not sure I'm expressing what I mean. But for example it's usually true that 1 == 1.0, even though the types are different.
Actually that 1==1f isn't legal in Fan I guess. But at least there I get a compile error, instead of a silent failure.
I don't know; it just seemed like it was so useful and sensible, the way it was documented: Lists are equal if their contents evaluate as equal. I could wish it really worked that way.
KevinKelley Tue 5 May 2009
sys::List fandoc says:
but this code:
gives this output:
Ignoring the bit about
d3
showing as Obj[] in spite of the typing and the cast; I'm thinking thatd1 == d2
should be true, not false. Same size, contains equal Int values.brian Tue 5 May 2009
The docs are incorrect - the types of the two lists must match also:
That can be a gotcha especially in testing for
verifyEq
, but I definitely think it is the correct behavior (especially for testing).I will fix the docs.
KevinKelley Tue 5 May 2009
Not sure I agree with that; doesn't
==
usually meanequivalent
, as opposed toidentical
? Not sure I'm expressing what I mean. But for example it's usually true that1 == 1.0
, even though the types are different.Actually that
1==1f
isn't legal in Fan I guess. But at least there I get a compile error, instead of a silent failure.I don't know; it just seemed like it was so useful and sensible, the way it was documented: Lists are
equal
if their contents evaluate as equal. I could wish it really worked that way.