You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5375 Reporter: edmcman Status: closed (set by @xavierleroy on 2011-10-15T08:47:22Z) Resolution: not fixable Priority: normal Severity: feature Category: ~DO NOT USE (was: OCaml general) Monitored by:@yakobowski
Bug description
compare and other polymorphic comparison functions are not defined for big_int types. We use big_ints in an abstract syntax tree type. Since compare does not work with big ints, we must manually write our own comparison functions, which is very unsatisfying (and tedious).
The text was updated successfully, but these errors were encountered:
I agree this is a annoying problem with big_int, but I'm afraid there is no solution: big_int is a mixed Caml/C datatype, with a Caml record encapsulating a sign, a size and a low-level "nat" type implemented in C. The custom comparison functions would have to be attached to the big_int type itself (attaching them to the "nat" type just gives the wrong results), and there is no way to do so in OCaml.
I can only recommend that you replace big_int by Zarith in your code: http://forge.ocamlcore.org/projects/zarith/
Not only Zarith is faster and more space-efficient than big_int, but it also supports polymorphic comparisons perfectly.
Original bug ID: 5375
Reporter: edmcman
Status: closed (set by @xavierleroy on 2011-10-15T08:47:22Z)
Resolution: not fixable
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @yakobowski
Bug description
compare and other polymorphic comparison functions are not defined for big_int types. We use big_ints in an abstract syntax tree type. Since compare does not work with big ints, we must manually write our own comparison functions, which is very unsatisfying (and tedious).
The text was updated successfully, but these errors were encountered: