From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 8307BBCAE for ; Mon, 11 Jul 2005 09:18:32 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j6B7IWHC003015 for ; Mon, 11 Jul 2005 09:18:32 +0200 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 JAA32459 for ; Mon, 11 Jul 2005 09:18:31 +0200 (MET DST) Received: from nproxy.gmail.com (nproxy.gmail.com [64.233.182.198]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j6B7IVTP003008 for ; Mon, 11 Jul 2005 09:18:31 +0200 Received: by nproxy.gmail.com with SMTP id d4so184463nfe for ; Mon, 11 Jul 2005 00:18:31 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=n960DuPJl0thqi1lol0cqDhzyQNa15EsaTwyykgE3bv0zcyTtz2reEtrFoP2AAg+d/1etHf7M788pz7Yvf+vDPttdJEfP9u/VEZd/wLZmg42WCY3vpfRiiNiho1kTdhGTw5I9JbaeMH5uQ8RQbCWrzBOVifVJ/rTVph89dcERnA= Received: by 10.48.240.12 with SMTP id n12mr124624nfh; Mon, 11 Jul 2005 00:18:30 -0700 (PDT) Received: by 10.48.43.8 with HTTP; Mon, 11 Jul 2005 00:18:30 -0700 (PDT) Message-ID: <6b8a9142050711001847d520c8@mail.gmail.com> Date: Mon, 11 Jul 2005 09:18:30 +0200 From: Remi Vanicat Reply-To: Remi Vanicat To: caml-list@inria.fr Subject: Re: [Caml-list] Object typing In-Reply-To: <20050711.000642.115315345.debian00@tiscali.be> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <42D063EC.3040900@earthlink.net> <20050711.000642.115315345.debian00@tiscali.be> X-Miltered: at nez-perce with ID 42D21D48.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42D21D47.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 christophe:01 troestler:01 bool:01 bool:01 val:01 christophe:01 ...:98 ...:98 typing:01 remi:01 remi:01 constraint:01 constraint:01 vanicat:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.2 X-Spam-Level: 2005/7/11, Christophe TROESTLER : [...] > # class ['a] entity =3D > object > method is_a (v:'a) =3D (v =3D `Entity) > end;; > class ['a] entity : > object constraint 'a =3D [> `Entity ] method is_a : 'a -> bool end > [...] > P.S. Notice the "_" in "_[> `Entity | `Predator ]". It means that > the full type is yet to be determined. Close it before the end of > your program. Notice that one can do better than this : # class [+'a] entity =3D object method is_a (v:'a) =3D (v =3D `Entity) end;; class ['a] entity : object constraint 'a =3D [> `Entity ] method is_a : 'a -> bool end # let e =3D new entity;; val e : [> `Entity ] entity =3D now we don't have an _ type, and there is no need to close it before the end of the program. (Ps: sorry Christophe for the private mail, I used the wrong button)