2011/6/27 xclerc <[email protected]>:

> The tests are failing because a try is made to compare two big arrays with 
> different layouts.
> It used to be accepted by the big array compare function, but now only big 
> arrays with the
> same kind and layout can be compared [1].

Technically, bigarrays that differ in kind or layout can still be
compared safely (= without crashing), but in 3.12.1 and up they will
never compare equal.

This is really a corner case, because in classic Caml and not using
Obj.repr nor Obj.magic, the two bigarrays being compared must have the
same static type and therefore the same kind and layout.  With
first-class modules today, or GADTs tomorrow, it is possible to
compare two values having different representation types.  That's why
polymorphic comparison in 3.12.1 was hardened so that it would behave
better in this case.

I'd be interested to understand why bin_prot ends up comparing
bigarrays of different layouts: is this an oversight in the test suite
or a strong requirement?

- Xavier Leroy

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to