caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Ruchira Datta <datta@math.berkeley.edu>
To: caml-list@inria.fr
Subject: [Caml-list] lablgtk polymorphic variants question
Date: Sun, 18 Mar 2001 22:13:50 -0800	[thread overview]
Message-ID: <20010318221350.A20863@blue1.berkeley.edu> (raw)

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


             reply	other threads:[~2001-03-19  6:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-19  6:13 Ruchira Datta [this message]
2001-03-19  9:43 ` Sven LUTHER
2001-03-19 13:58   ` Stefano Zacchiroli
2001-03-19 10:27 ` Jacques Garrigue
2001-03-19 17:33 Ruchira Datta
2001-03-20  5:23 Ruchira Datta
2001-03-20 14:03 ` Jacques Garrigue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010318221350.A20863@blue1.berkeley.edu \
    --to=datta@math.berkeley.edu \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).