Browse thread
[Caml-list] Invalid_argument("equal: abstract value")?
-
Tom Hawkins
-
Tom Hawkins
- skaller
-
Tom Hawkins
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ 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