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 HAA25796; Mon, 19 Mar 2001 07:13:54 +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 HAA26236 for ; Mon, 19 Mar 2001 07:13:53 +0100 (MET) Received: from math.berkeley.edu (gold.Math.Berkeley.EDU [169.229.58.61]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f2J6DqP12618 for ; Mon, 19 Mar 2001 07:13:52 +0100 (MET) Received: from blue1.math.Berkeley.EDU (blue1.Math.Berkeley.EDU [169.229.58.58]) by math.berkeley.edu (8.9.3/8.9.3) with ESMTP id WAA11789; Sun, 18 Mar 2001 22:13:50 -0800 (PST) Received: (from datta@localhost) by blue1.math.Berkeley.EDU (8.9.3/8.9.3) id WAA21595; Sun, 18 Mar 2001 22:13:50 -0800 (PST) Date: Sun, 18 Mar 2001 22:13:50 -0800 From: Ruchira Datta To: caml-list@inria.fr Subject: [Caml-list] lablgtk polymorphic variants question Message-ID: <20010318221350.A20863@blue1.berkeley.edu> Reply-To: datta@math.berkeley.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I tried to compile lablgtkmathview but ran into an error. I would guess that it probably compiled under OCaml 3.00 but doesn't for me since I have 3.01. I have lablgtk 1.2.0. (Everything is from Sven Luther's Debian packages, except lablgtkmathview and mlminidom which don't seem to be packaged yet.) The error: File "gMathView.ml", line 61, characters 36-58: This expression has type [ `frame] Gtk.obj but is here used with type Gtk.frame Gtk.obj Type [ `frame] is not compatible with type Gtk.frame = [ `widget | `container | `bin | `frame] The offending line is: method get_frame = new GBin.frame (MathView.get_frame obj) The declaration of MathView.get_frame is on lines 85-86 of gtkMathView.ml, in module MathView: external get_frame : [>`math_view] obj -> [`frame] obj = "ml_gtk_math_view_get_frame" The declaration of Gtk.frame is on line 95 of gtk.ml: type frame = [`widget|`container|`bin|`frame] I guess I don't fully understand polymorphic variants. It would have seemed to me that if (new GBin.frame) expects an argument of type Gtk.frame, then something of type [ 'frame] should satisfy it. Why should it be necessary that all four variants [`widget|`container|`bin|`frame] be able to occur? I thought that the inferred type of a function would always allow less variants in its argument. Ruchira Datta datta@math.berkeley.edu ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr