From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 791407EE51 for ; Tue, 21 May 2013 06:07:42 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of bobzhang1988@gmail.com) identity=pra; client-ip=209.85.216.182; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="bobzhang1988@gmail.com"; x-sender="bobzhang1988@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of bobzhang1988@gmail.com designates 209.85.216.182 as permitted sender) identity=mailfrom; client-ip=209.85.216.182; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="bobzhang1988@gmail.com"; x-sender="bobzhang1988@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-qc0-f182.google.com) identity=helo; client-ip=209.85.216.182; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="bobzhang1988@gmail.com"; x-sender="postmaster@mail-qc0-f182.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: An4CAMjxmlHRVdi2k2dsb2JhbAA/GhaDIsFPgQkWDgEBAQEHCwsJFAQkgh8BAQEEAQEBNQgBGxwBAQMMBgULDQkWDwkDAgECARERAQUBHAYNAQcBARCHZgEDDwwzngGMP4J9hG8KGScNWId7AQUMjW2BKAeDVAOXOIEpjjI/hFE X-IPAS-Result: An4CAMjxmlHRVdi2k2dsb2JhbAA/GhaDIsFPgQkWDgEBAQEHCwsJFAQkgh8BAQEEAQEBNQgBGxwBAQMMBgULDQkWDwkDAgECARERAQUBHAYNAQcBARCHZgEDDwwzngGMP4J9hG8KGScNWId7AQUMjW2BKAeDVAOXOIEpjjI/hFE X-IronPort-AV: E=Sophos;i="4.87,712,1363129200"; d="scan'208";a="18236565" Received: from mail-qc0-f182.google.com ([209.85.216.182]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 21 May 2013 06:07:41 +0200 Received: by mail-qc0-f182.google.com with SMTP id n1so99985qcw.27 for ; Mon, 20 May 2013 21:07:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:newsgroups:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=Ay+cL8KnVbeiQkyLCWUvo7VeYjftsLcaIG/hItPxmu8=; b=bNiIEEPkHF8gPim72sHClacj/XdJchYYZ3iMYkMs5BgHrR+0MAvEAqrO0GMzrR71op jG7M25kGpdKF/vh6lyfFdIKxAOXS7itNSyh6IGKfAuzGfU0CMXifBE/4kwpgMzeKT1y4 lPvvMSMLAYP5AMHfNTC6ht9i4EbIn6upvkp8VyxnH7QiefYRj9FjKvhbGmE02Us3aVwJ KxJG3N47GdIl4iedPLVZnLHRqqFsIN05kQYvXP3F1igTKSGh0xpUftXZWd3TX7RGC8ie GUw/GN7BjZ0ldKSGh1EtkHyumZSGlZJ7dp0J7zjCQP4WcATCVL/uA/WK3ymoPCC2BvhU 3gOw== X-Received: by 10.229.8.133 with SMTP id h5mr182885qch.148.1369109260653; Mon, 20 May 2013 21:07:40 -0700 (PDT) Received: from Hongbos-MacBook-Air.local ([66.250.143.158]) by mx.google.com with ESMTPSA id m7sm1669997qaa.13.2013.05.20.21.07.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 20 May 2013 21:07:39 -0700 (PDT) Message-ID: <519AF309.4040901@gmail.com> Date: Tue, 21 May 2013 00:07:37 -0400 From: Hongbo Zhang User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 Newsgroups: gmane.comp.lang.caml.inria To: Dario Teixeira CC: OCaml mailing-list References: <1369060290.43256.YahooMailNeo@web120405.mail.ne1.yahoo.com> In-Reply-To: <1369060290.43256.YahooMailNeo@web120405.mail.ne1.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Caml-list] Re: The rec/nonrec debate On 5/20/13 10:31 AM, Dario Teixeira wrote: > Hi, > Hi, I would like to have a self keyword (for the convenience of copy-paste and metaprogramming :-)) -------------- type 'a t = A of 'a self | B of 'a self | C of string type 'a t1 = A of 'a self | B of 'a self | C of string | D of int ---- If we don't like to introduce a new keyword, just replace self with an existing keyword , e.g, rec. > > As you know, there is in OCaml some asymmetry regarding the rec/nonrec > defaults for type and value declarations. Types are recursive by default > and there's no way to "unrecurse" them, whereas values are by default not > recursive and can be made recursive via the "rec" keyword. > > The unrecursiveness of type declarations is cause for some chagrin, as a > recent ticket on Mantis demonstrates [1]. > > Here's something I wonder: if one were to wipe the slate clean, is there > consensus among the community about the best defaults? I'm leaning towards > having nonrec as the default behaviour for *both* types and values, and > using "rec" as the keyword for recursive types and values. This scheme > would obviate the need for an actual "nonrec" keyword. > > Obviously, such a change would be too intrusive to make to OCaml. However, > since people are working on "Next Generation ML" languages like Mezzo [2], > I think it would be good to get the community's pulse on this subject. > (Btw, from the examples posted on Mezzo's homepage, it seems to use the > same defaults as OCaml). > > Your thoughts? > > Best regards, > Dario Teixeira > > [1] http://caml.inria.fr/mantis/view.php?id=6016 > [2] http://gallium.inria.fr/~protzenk/mezzo-lang/ > >