Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Invalid_argument("equal: abstract value")?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-12-31 (22:26)
From: Tom Hawkins <tom@l...>
Subject: Re: [Caml-list] Invalid_argument("equal: abstract value")?
On Wednesday 31 December 2003 03:55 pm, Tom Hawkins wrote:
> I haven't seen this error before.  Can someone provide an
> explanation?
> I've traced the problem down to a structural comparison (=) between
> two large data structures.  I know functional comparisons are a
> no-no, but what is an "abstract value"?
> The problem occurred when I added big integers (Big_int.big_int) to
> the data structures under comparison.  Suspecting big ints can't be
> structurally compared, I tried the following, but the compiler
> printed "false" as I would normally expect:
>   let a = Big_int.zero_big_int = Big_int.unit_big_int in
>   if a then print_string "true\n" else print_string "false\n";

Further suspecting Big_int.zero_big_int and Big_int.unit_big_int are 
special cases, I tried:

  Big_int.big_int_of_string "123" = Big_int.big_int_of_string "456"

Sure enough, 'Invalid_argument("equal: abstract value")'.  So what's 
the reasoning?  (It's no big deal.  I've already built a structural 
comparison function for my problem as a work-around.)


Tom Hawkins
Launchbird Design Systems, Inc.

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: