From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id B6EC67ED34 for ; Wed, 18 Jul 2012 18:53:46 +0200 (CEST) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of oandrieu@gmail.com) identity=pra; client-ip=209.85.215.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="oandrieu@gmail.com"; x-sender="oandrieu@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of oandrieu@gmail.com designates 209.85.215.182 as permitted sender) identity=mailfrom; client-ip=209.85.215.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="oandrieu@gmail.com"; x-sender="oandrieu@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ey0-f182.google.com) identity=helo; client-ip=209.85.215.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="oandrieu@gmail.com"; x-sender="postmaster@mail-ey0-f182.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4CAPzoBlDRVde2k2dsb2JhbABFuAsDgR4IIgEBAQEJCQsJFAQjgiABAQEDARICExkBOAEDAQsBBQULDS4iEgEFARwGExsHh1wDBgafOgkDjxSFTicNiUgBBQyLNIEMhUMDlUSOLD6BVIIs X-IronPort-AV: E=Sophos;i="4.77,610,1336341600"; d="scan'208";a="151072002" Received: from mail-ey0-f182.google.com ([209.85.215.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 18 Jul 2012 18:53:46 +0200 Received: by eabm6 with SMTP id m6so831290eab.27 for ; Wed, 18 Jul 2012 09:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=16pB6b382T0DjydBOg3AUl4vcK8gOhkJ/7hFxZpZ0N8=; b=FZxOeQOgy67zU5Tbx4LR1uO76iesqVWAn5yiLCfBqBPL8P5fKtw1WW/+BfYWct9aOH guwhB9XSwkJ40vTTx+PPItOrIYnED/9sUxjUZcdfA28ePYoiMkPpFuhftnldnxh+PuxU hDO9d2OELVQHSGOQBCnkKvtGMQ1mJLvFnoXMQ5uL1itt/47isrNe4+ExOJ76PILm9A/6 uXYc5aOBBktVb/efYWdXIvNo/BgiqGf/KftCi3MQseWUUcQHpzvgKk5OwZvzvT8Ab12F yYSVFnrnCSSw/efMc9KU6Ke3qu76aDBWGZkjiV4AMpZVQktXcOnP0hNHZaQVpdYYPm2D 5M9Q== MIME-Version: 1.0 Received: by 10.14.175.5 with SMTP id y5mr4890633eel.40.1342630425510; Wed, 18 Jul 2012 09:53:45 -0700 (PDT) Sender: oandrieu@gmail.com Received: by 10.14.133.12 with HTTP; Wed, 18 Jul 2012 09:53:45 -0700 (PDT) In-Reply-To: <587471342513938@web8h.yandex.ru> References: <678391342421391@web21g.yandex.ru> <587471342513938@web8h.yandex.ru> Date: Wed, 18 Jul 2012 18:53:45 +0200 X-Google-Sender-Auth: jRTs3fYYDdGpqJcaYtK6gveoE2c Message-ID: From: Olivier Andrieu To: Ivan Cc: "caml-list@inria.fr" Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Caml-list] passing object to a function fails to compile (lablgtk2 involved) On Tue, Jul 17, 2012 at 10:32 AM, Ivan wrote: > Method set (which I'm suspecting as a cause of a failure) has type, that contains type quantifier: > "'a. row:Gtk.tree_iter -> column:'a column -> 'a -> unit". Right now, type quantifiers are out of my ocaml's > active vocabulary. In other words I do not know, how to handle them properly. Yes, the GTree.list_store has a polymorphic method #set. Such methods usually need a type annotation otherwise the type inference will give you a regular non-polymorphic type for the method. In your case the simple solution would be to constrain your model argument : let fill_model (model : GTree.list_store) name_col value_col = (not tested :) > Moreover, I still have no insight on the variable 'b. Why do the compiler refers to some 'b, without even mentioning it in the types it inferred? It's very strange for me. This 'b variable is hidden in GTree.list_store I think. A class name such as GTree.list_store acts like an alias for the corresponding object type, here something like < ... set : 'b. row:Gtk.tree_iter -> column:'b GTree.column-> 'b -> unit ... >. -- Olivier