From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id EAA01298; Thu, 1 Jan 2004 04:18:57 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id EAA01106 for ; Thu, 1 Jan 2004 04:18:55 +0100 (MET) Received: from maury.inria.fr (maury.inria.fr [192.93.2.7]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id i013ALv17772 for ; Thu, 1 Jan 2004 04:10:33 +0100 (MET) Received: from mail2.tpgi.com.au (mail.tpgi.com.au [203.12.160.58]) by maury.inria.fr (8.12.10/8.12.10) with ESMTP id i013AH9q012836 for ; Thu, 1 Jan 2004 04:10:19 +0100 Received: from 203-219-16-144-syd-ts21-2600.tpgi.com.au (203-219-16-144-syd-ts21-2600.tpgi.com.au [203.219.16.144]) by mail2.tpgi.com.au (8.12.10/8.12.10) with ESMTP id i013ABB9026191; Thu, 1 Jan 2004 14:10:13 +1100 Subject: Re: [Caml-list] Invalid_argument("equal: abstract value")? From: skaller Reply-To: skaller@ozemail.com.au To: Tom Hawkins Cc: caml-list In-Reply-To: <200312311621.51555.tom@launchbird.com> References: <200312311555.47555.tom@launchbird.com> <200312311621.51555.tom@launchbird.com> Content-Type: text/plain Message-Id: <1072926610.4197.81.camel@pelican> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 01 Jan 2004 14:10:11 +1100 Content-Transfer-Encoding: 7bit X-TPG-Antivirus: Passed X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 ozemail:01 2004:99 bigint:01 bigints:01 finalisers:01 hooks:01 opaque:01 python:01 compiler:01 ocaml:01 int:01 int:01 marshal:01 reasoning:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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