From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.8 required=5.0 tests=AWL,SPF_SOFTFAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id E3DA4BC57 for ; Mon, 12 Oct 2009 10:58:19 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlsBALOM0kqEpqxqmWdsb2JhbACbCgEBAQEBCAsKBxO7HoQtBA X-IronPort-AV: E=Sophos;i="4.44,544,1249250400"; d="eml'208?scan'208,208";a="38055468" Received: from cirse-out.extra.cea.fr ([132.166.172.106]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 12 Oct 2009 10:58:19 +0200 Received: from pisaure.intra.cea.fr (pisaure.intra.cea.fr [132.166.88.21]) by cirse.extra.cea.fr (8.14.2/8.14.2/CEAnet-Internet-out-2.0) with ESMTP id n9C8wJPD022940 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 12 Oct 2009 10:58:19 +0200 Received: from muguet2.intra.cea.fr (muguet2.intra.cea.fr [132.166.192.7]) by pisaure.intra.cea.fr (8.14.2/8.14.2) with ESMTP id n9C8wJWd004272 for ; Mon, 12 Oct 2009 10:58:19 +0200 (envelope-from Julien.Signoles@cea.fr) Received: from [132.166.132.51] (is010215.intra.cea.fr [132.166.132.51]) by muguet2.intra.cea.fr (8.13.8/8.13.8/CEAnet-Intranet-out-1.1) with ESMTP id n9C8wJIj029178 for ; Mon, 12 Oct 2009 10:58:19 +0200 Message-ID: <4AD2EFAB.9000807@cea.fr> Date: Mon, 12 Oct 2009 10:58:19 +0200 From: Julien Signoles User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: caml list Subject: [Fwd: Re: [Caml-list] Re: Improving OCaml's choice of type to display] Content-Type: multipart/mixed; boundary="------------020805050900040809030800" X-Spam: no; 0.00; signoles:01 signoles:01 ocaml's:01 furuse:01 struct:01 struct:01 avoided:01 compiler:01 typing:01 typing:01 caml-list:01 caml-list:01 cea:01 int:01 expression:02 X-Attachments: name="Re: [Caml-list] Re: Improving OCaml's choice of type to display.eml" This is a multi-part message in MIME format. --------------020805050900040809030800 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sorry, forgot the caml-list. --------------020805050900040809030800 Content-Type: message/rfc822; name="Re: [Caml-list] Re: Improving OCaml's choice of type to display.eml" Content-Transfer-Encoding: 8bit Content-Disposition: inline; filename*0="Re: [Caml-list] Re: Improving OCaml's choice of type to disp"; filename*1="lay.eml" Message-ID: <4AD2EF7E.2080105@cea.fr> Date: Mon, 12 Oct 2009 10:57:34 +0200 From: Julien Signoles User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Jun Furuse Subject: Re: [Caml-list] Re: Improving OCaml's choice of type to display References: <891bd3390910081840p37e8c786g60b2c15d2c06ae60@mail.gmail.com> <891bd3390910081853m5409c871y35495c6f16e180aa@mail.gmail.com> <5160b4200910110757y47ffad15v70434418cba61f26@mail.gmail.com> <62B782AA-1F44-4207-B037-5C6D1F6CBF50@gmail.com> <5160b4200910110824q7998f43ao3d00e94ba7e74b2b@mail.gmail.com> In-Reply-To: <5160b4200910110824q7998f43ao3d00e94ba7e74b2b@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Jun Furuse a écrit : > I have not tested it well but it counts dots and should try to find > the minimal one. > > A problem I have found so far is that it prints something confusing, ex. > > module M = struct type t end > module N = struct type t end > open M > open N > > let _ = ( 1 : M.t ) > >>> Error: This expression has type int but an expression was expected of type t (which t ?!?!?) From the typing environment, it refers to N.t. Hence the type error message is not correct. > If there are types M.t and N.t and the both of M and N are opened, > these types are printed just "t". This can be avoided by testing the > result name "t" against the current typing envrionment to see it > really means the original type "M.t". This requires more coding but > the weekend has ended in the far east already :-) (It's 0:24 Monday > now.) One solution could be the following. Let M.t the unique long type name to simplify and let P the longest prefix of M removed with the "do not print opened modules" rule. After simplifying the long name M.t to (M - P).t (that is what your implementation does, if I well understood), add the shortest suffix S of M.t such that (M - P).S.t is visible in the current typing environment. Don't know how hard is to implement such a solution in the caml compiler. -- Julien --------------020805050900040809030800--