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 1DF96BC37 for ; Mon, 12 Oct 2009 10:58:07 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhgCALOM0kqEpqxqmWdsb2JhbACDAZgJAQEBAQEICwoHE7sehC0E X-IronPort-AV: E=Sophos;i="4.44,544,1249250400"; d="eml'208?scan'208,208";a="38055338" 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:06 +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 n9C8w6Bc022749 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 12 Oct 2009 10:58:06 +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 n9C8w6KY004171 for ; Mon, 12 Oct 2009 10:58:06 +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 n9C8w64E029056 for ; Mon, 12 Oct 2009 10:58:06 +0200 Message-ID: <4AD2EF9E.8060400@cea.fr> Date: Mon, 12 Oct 2009 10:58:06 +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="------------030509020708090700020503" X-Spam: no; 0.00; signoles:01 signoles:01 ocaml's:01 furuse:01 furuse:01 compiler:01 compiler:01 choosen:01 hacks:01 wrote:01 caml-list:01 caml-list:01 cea:01 int:01 int:01 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. --------------030509020708090700020503 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sorry, forgot the caml-list. --------------030509020708090700020503 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: <4AD2ED64.8020408@cea.fr> Date: Mon, 12 Oct 2009 10:48:36 +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> In-Reply-To: <5160b4200910110757y47ffad15v70434418cba61f26@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Jun Furuse a écrit : > I have quickly wrote a small patch against 3.11.1 for this feature, to > see what it would be like. > > http://sites.google.com/a/furuse.info/jun/hacks/other-small-ocaml-patches > > With this patch, path names are printed without opened modules in the > context. Do not print included modules as well would be better. However, after a quick look in the source of the caml compiler, it seems to be really harder to implement that the "do not print opened" rule. It also tries heuristic data type name simplification: if a > variant/record data type is an alias of another data type whose name > is shorter than the original, the printer uses the latter. > # type long_name = int;; > type long_name = int > # (1 : t);; > - : t = 1 (* t is the shorter than its original type int *) > # (1 : long_name);; > - : int = 1 (* int is shorter name for long_name. t > is even shorter but not aliased unfortunatelly. *) I definitevely prefer to have long_name instead of int here: long_name is the name that the user choses in this context. From my point of view, the compiler should always use the name choosen by the user whenever possible. -- Julien --------------030509020708090700020503--