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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id B9BA87EC41 for ; Fri, 26 Oct 2012 05:32:34 +0200 (CEST) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of lambda.q.q@gmail.com) identity=pra; client-ip=209.85.215.54; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="lambda.q.q@gmail.com"; x-sender="lambda.q.q@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of lambda.q.q@gmail.com designates 209.85.215.54 as permitted sender) identity=mailfrom; client-ip=209.85.215.54; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="lambda.q.q@gmail.com"; x-sender="lambda.q.q@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-la0-f54.google.com) identity=helo; client-ip=209.85.215.54; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="lambda.q.q@gmail.com"; x-sender="postmaster@mail-la0-f54.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai0CAJIDilDRVdc2k2dsb2JhbABEhU9HvBcIIwEBAQEJCQsJFAQjgh4BAQEDARICDx0BOAEDAQsBBQUaAgUhAgIPAQQNEwEFASITGweHUAMJBgSeF2AJA4tfg0WFJCcNiU4BBQyBFIlahkGBEwOIVohigmmBVYstgy8/gViCPg X-IronPort-AV: E=Sophos;i="4.80,652,1344204000"; d="scan'208";a="178987358" Received: from mail-la0-f54.google.com ([209.85.215.54]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 26 Oct 2012 05:32:34 +0200 Received: by mail-la0-f54.google.com with SMTP id e12so3825743lag.27 for ; Thu, 25 Oct 2012 20:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; bh=KlFkp92N3fe9CBKNNL2t8zz3dm2DeZjJGkqNXb5BIGY=; b=O1nKWZj2fh6gFZhTo8mFjKlbNHgzfnUWuClkwg3gZYv9OxOvyJR7HojasmAT+tLvS0 RHyqFXYo7UjNVyLLZNjFnXLNKwVaTSueYCxIDDYgQByvpEu3LaFN0cORPbJVNsCxGxM2 QEK33AofiGu63E43b7WUQyvc/VJ/4Yd8BcIVkjcOiNPYTMqE2MXpil29bXNOBtHW9bbz KmpUzm4KpYYfX6b/lI0liC/mb3LJIFfOjrNWmNbJ4O9WaUEBlQGBRWPqWIHYAxcW8r8b c8vjx5WvkKnPAW5UcQd6Kex+eiDnFpUGz04rBCBTyTVsUUlR7RudfyguENJaHlfJKUmJ HOeQ== Received: by 10.152.105.236 with SMTP id gp12mr19484275lab.35.1351222353807; Thu, 25 Oct 2012 20:32:33 -0700 (PDT) Received: from golf.niidar.ru.niidar.ru ([178.176.155.109]) by mx.google.com with ESMTPS id gk11sm80123lab.3.2012.10.25.20.32.32 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 25 Oct 2012 20:32:33 -0700 (PDT) Sender: Ivan Gotovchits From: Ivan Gotovchits To: Didier Cassirame Cc: caml-list@inria.fr References: <87txtiix6r.fsf@golf.niidar.ru> Date: Fri, 26 Oct 2012 07:37:40 +0400 In-Reply-To: (Didier Cassirame's message of "Thu, 25 Oct 2012 14:14:58 +0200") Message-ID: <87a9v99a4b.fsf@golf.niidar.ru> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] Polymorphic variants and inheritance Didier Cassirame writes: > type odds =3D [`One | `Three ] > type evens =3D [`Two | `Four ] > type numbers =3D [ odds | evens ] > > class type ['a] number =3D object > =C2=A0 constraint 'a =3D [< numbers] > =C2=A0 method category: 'a > end > > class type odd =3D object > =C2=A0 inherit [odds] number > =C2=A0 method category: odds > end > > class type even =3D object > =C2=A0 inherit [evens] number=C2=A0 > =C2=A0 method category: evens > end > > It's probably even better like this :) > It's an excellent solution, Didier! Thanks alot =3D)