From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 20D39BC57 for ; Fri, 5 Nov 2010 15:45:32 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiIBAIa100zRVdU0k2dsb2JhbAChaQgVAQEBAQkJCgkRAx+hKYtzhSiJBwEBAwWFQgSEVYYAg2yFNQ X-IronPort-AV: E=Sophos;i="4.58,303,1286143200"; d="scan'208";a="77317298" Received: from mail-yw0-f52.google.com ([209.85.213.52]) by mail4-smtp-sop.national.inria.fr with ESMTP; 05 Nov 2010 15:45:31 +0100 Received: by ywf7 with SMTP id 7so2216831ywf.39 for ; Fri, 05 Nov 2010 07:45:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=YKDLoniiijPdh2+v11FvDAaQdML/eSmmhHIw1QlP4Zo=; b=x58cJ5Az8nOiWbZNvKSSI0mLV+8L81uBrigKoHvjK1gECB/YE9w6vYG4Ah0sUIGZYK 8WHT1f/5IIvuQJcKlPHooIsL1bTxx/qwhe3FGi5xwY4ZLmWIOVaSwIwKk7afcCnc224h E9Q6lyAuaP/xyDrJpTWYZUfJtMc/Kvb5FtCJ8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=M601kg490SqJ97ZyzhNYKU/5zsGSIh2ToT0+x9qPEK2NfKpB7rEGhiVl5tZMZdW9p6 DJTqzjhaUAXjXFIQIvaByrQIgKndOOnpgE2jq2TPXgu7vKPuGK063XeNv5Y5unGVysVW xf74+IujE3nbi/GBww49cw6YIUxt/+VeepXQ0= Received: by 10.151.9.3 with SMTP id m3mr3572865ybi.183.1288968330491; Fri, 05 Nov 2010 07:45:30 -0700 (PDT) Received: from tet.garrigue.jp (58x158x128x157.ap58.ftth.ucom.ne.jp [58.158.128.157]) by mx.google.com with ESMTPS id r29sm2577413ybn.10.2010.11.05.07.45.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 05 Nov 2010 07:45:29 -0700 (PDT) Sender: Jacques Garrigue Subject: Re: [Caml-list] Merging object signatures Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Jacques Garrigue In-Reply-To: <482197.73063.qm@web111512.mail.gq1.yahoo.com> Date: Fri, 5 Nov 2010 23:45:25 +0900 Cc: caml-list@yquem.inria.fr Content-Transfer-Encoding: quoted-printable Message-Id: <3D8D99E9-F325-4697-B261-4B39E3E7F00A@gmail.com> References: <482197.73063.qm@web111512.mail.gq1.yahoo.com> To: Dario Teixeira X-Mailer: Apple Mail (2.1081) X-Spam: no; 0.00; merging:01 foo:01 foobar:01 foo:01 val:01 bool:01 foobar:01 val:01 bool:01 verbose:01 syntax:01 verbose:01 wrote:01 signatures:01 caml-list:01 On 2010/11/05, at 21:58, Dario Teixeira wrote: >> Can't you make foo_t and bar_t class types and foobar_t inherits them >> both? >=20 > Thanks for the reply. Yes, in the toy example I posted that would = indeed > be an alternative. Still, I'm wondering about the most general case; > suppose I had a function that took an object satisfying both foo_t and = bar_t: >=20 > val do_something: < foo_t; bar_t; .. > -> bool >=20 > This is what I'm wondering if it's possible to express. Same thing: class type foobar_t =3D object inherit foo_t inherit bar_t end val do_something : #foobar_t -> bool I agree that this is rather verbose. I thought a few times of adding the syntax you propose, but was always stopped by the fact you can already do it in a verbose way. Jacques Garrigue=