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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id AF5047EE6B for ; Tue, 3 Dec 2013 13:33:15 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of alain@frisch.fr) identity=pra; client-ip=193.252.23.211; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="alain@frisch.fr"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of alain@frisch.fr) identity=mailfrom; client-ip=193.252.23.211; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="alain@frisch.fr"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@msa.smtpout.orange.fr) identity=helo; client-ip=193.252.23.211; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain@frisch.fr"; x-sender="postmaster@msa.smtpout.orange.fr"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnYBABrPnVLB/BfTnGdsb2JhbABahwyyaIMFgTEOAQEBAQEICwkJFCiCJQEBBSMVQAEQCxgCAgUWCwICCQMCAQIBRQYNAQcBAYgBsQGQTxeBKY1VB4JrgUgDmBSGRY54 X-IPAS-Result: AnYBABrPnVLB/BfTnGdsb2JhbABahwyyaIMFgTEOAQEBAQEICwkJFCiCJQEBBSMVQAEQCxgCAgUWCwICCQMCAQIBRQYNAQcBAYgBsQGQTxeBKY1VB4JrgUgDmBSGRY54 X-IronPort-AV: E=Sophos;i="4.93,817,1378850400"; d="scan'208";a="46715158" Received: from msa02.smtpout.orange.fr (HELO msa.smtpout.orange.fr) ([193.252.23.211]) by mail2-smtp-roc.national.inria.fr with ESMTP; 03 Dec 2013 13:33:15 +0100 Received: from [192.168.1.132] ([92.151.88.188]) by mwinf5d58 with ME id x0ZD1m00F43pGFQ030ZDJx; Tue, 03 Dec 2013 13:33:14 +0100 Message-ID: <529DCF8A.2040308@frisch.fr> Date: Tue, 03 Dec 2013 13:33:14 +0100 From: Alain Frisch User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Jeremy Yallop CC: Dmitri Boulytchev , caml-list References: <529BAB43.3080105@gmail.com> <529D97B4.9070108@frisch.fr> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Confusing behaviour of type inference for polymorphic classes. On 12/03/2013 11:17 AM, Jeremy Yallop wrote: > Using recursive modules certainly makes it possible to write a class > with the correct type, but unless I'm mistaken you lose the ability to > override the behaviour on recursive calls -- i.e. the call to (new > X.m)#t can no longer be replaced with a call through a self variable. The instance on which the method is called cannot be "self", since it corresponds to different type parameters for the class. I don't know what Dmitri is exactly looking for, but maybe a polymorphic method (instead of a parametrized class) would do the job as well. -- Alain