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: 2004-01-01 (03:18)
From: skaller <skaller@o...>
Subject: Re: [Caml-list] Invalid_argument("equal: abstract value")?
On Thu, 2004-01-01 at 09:21, Tom Hawkins wrote:
> On Wednesday 31 December 2003 03:55 pm, Tom Hawkins wrote:

>   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? 

A bigint is (well, at least contains) an abstract 
primitive defined in C, not an algebraic data type.
The compiler doesn't know how to compare bigints.

This could be fixed the same way as for finalisers ..
provide a table of hooks for custom blocks.
Another candidate other than comparison is obviously
serialisation to extend Marshal for abstract/opaque types.

The problem is .. there's no limit to where you'd like
dynamic polymorphism.. you'd end up with Python not Ocaml.

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