English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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 caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners