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 LAA28266; Mon, 19 Mar 2001 11:26:01 +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 LAA30299 for ; Mon, 19 Mar 2001 11:25:59 +0100 (MET) Received: from tet.kurims.kyoto-u.ac.jp (L024148.ppp.dion.ne.jp [211.126.24.148]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f2JAPuP16514 for ; Mon, 19 Mar 2001 11:25:57 +0100 (MET) Received: from localhost (localhost [127.0.0.1]) by tet.kurims.kyoto-u.ac.jp (8.11.1/8.11.1) with ESMTP id f2JARaE00515; Mon, 19 Mar 2001 19:27:36 +0900 (JST) (envelope-from garrigue@kurims.kyoto-u.ac.jp) To: datta@math.berkeley.edu Cc: caml-list@inria.fr Subject: Re: [Caml-list] lablgtk polymorphic variants question In-Reply-To: <20010318221350.A20863@blue1.berkeley.edu> References: <20010318221350.A20863@blue1.berkeley.edu> X-Mailer: Mew version 1.94.2 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20010319192736S.garrigue@kurims.kyoto-u.ac.jp> Date: Mon, 19 Mar 2001 19:27:36 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: Ruchira Datta > 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: [...] > 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" This is wrong. This should be: external get_frame : [>`math_view] obj -> Gtk.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. LablGTK uses an encoding of widget types, in variant types, were variant types are used as capacities. This can seem a bit unusual, but you can see it in the fact the Gtk.obj abstract type is contravariant. Jacques Garrigue ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr