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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 84B5D7EE51 for ; Mon, 20 May 2013 16:38:06 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of dhouse@janestreet.com) identity=pra; client-ip=38.105.200.229; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="dhouse@janestreet.com"; x-sender="dhouse@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of dhouse@janestreet.com designates 38.105.200.229 as permitted sender) identity=mailfrom; client-ip=38.105.200.229; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="dhouse@janestreet.com"; x-sender="dhouse@janestreet.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@tot-dmz-mxout1.janestreet.com) identity=helo; client-ip=38.105.200.229; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="dhouse@janestreet.com"; x-sender="postmaster@tot-dmz-mxout1.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At0BAE80mlEmacjlnGdsb2JhbABAGhaDIq8gkh92Hg4BAQEBAQYNCQkUKIIfAQEFQAEBLAsBDwsLDQ0hIhIBBQEKEgYTCAoCh2cDDwMJM51Pin6EPgEFhFYDiHIGjEqBL4EoB4NUlVmBYoEpinSDPhYphDY X-IPAS-Result: At0BAE80mlEmacjlnGdsb2JhbABAGhaDIq8gkh92Hg4BAQEBAQYNCQkUKIIfAQEFQAEBLAsBDwsLDQ0hIhIBBQEKEgYTCAoCh2cDDwMJM51Pin6EPgEFhFYDiHIGjEqBL4EoB4NUlVmBYoEpinSDPhYphDY X-IronPort-AV: E=Sophos;i="4.87,707,1363129200"; d="scan'208";a="15034767" Received: from mx5.janestreet.com (HELO tot-dmz-mxout1.janestreet.com) ([38.105.200.229]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 20 May 2013 16:38:05 +0200 Received: from tot-oib-smtp1.delacy.com ([172.27.22.15] helo=tot-smtp) by tot-dmz-mxout1.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1UeRDv-0002rc-Jb for caml-list@inria.fr; Mon, 20 May 2013 10:38:03 -0400 Received: from tot-dmz-mxgoog1.delacy.com ([172.27.224.14] helo=mxgoog2.janestreet.com) by tot-smtp with esmtps (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1UeRDv-0000MN-In for caml-list@inria.fr; Mon, 20 May 2013 10:38:03 -0400 Received: from mail-oa0-f52.google.com ([209.85.219.52]) by mxgoog2.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1UeRDv-00009d-GI for caml-list@inria.fr; Mon, 20 May 2013 10:38:03 -0400 Received: by mail-oa0-f52.google.com with SMTP id h1so7846184oag.11 for ; Mon, 20 May 2013 07:38:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=x-received:mime-version:x-received:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=vVNacn73YjFJJeNM5yoUcvcq8Ti31+nBvBTv6JgGvf0=; b=UR5k1Q49E3YUzbJWxIs7v8M1maqUnLOaf61nq20afEp/usvqtO+ipHR3Np4WO1QOiH zt2viac8d580wMpu4g7dGYRbt1PHXPJ5Y5F3niIJLPBzo6hjxKdlV/5QdvAZpLSlGURV 7QxXEGsdF6jsMn3GAJ7MOPbzZhklwm/YnBq08= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-received:in-reply-to:references:date :message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=vVNacn73YjFJJeNM5yoUcvcq8Ti31+nBvBTv6JgGvf0=; b=POwcn6L3hGVSsDS/okAn0db2Lu3D7AQyKgGnOaz88ovq5rWUmBKBbuC1Ivi7SANWsn VHpjI9LmryfzXHGC6n1/qOarstBBGuEa0Fu3RKtUzO2kAYG20H+jitfcs5Pm0+3i7ab+ 3DVVWpeQDWd5D266V2h5UAKVA3hUurpxhuihifwkpb10XSaaXCwH0gtm/sjkFZ7rUekH EypcjGq5VdR+pIj8S/aaMc5C/cup4bTF0FCzwRwkREKHywtBpQAj6ukiqpy/nYySu/Y2 ERFQRMscr4X9OeBVhBXJG5EWI+CU3JQ7+KcA/tRI7btKb84FwGFaupboIjgyiepEZCyr 9Ibw== X-Received: by 10.182.130.138 with SMTP id oe10mr26794891obb.90.1369060683230; Mon, 20 May 2013 07:38:03 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.130.138 with SMTP id oe10mr26794886obb.90.1369060683145; Mon, 20 May 2013 07:38:03 -0700 (PDT) Received: by 10.76.171.135 with HTTP; Mon, 20 May 2013 07:38:03 -0700 (PDT) In-Reply-To: <1369060290.43256.YahooMailNeo@web120405.mail.ne1.yahoo.com> References: <1369060290.43256.YahooMailNeo@web120405.mail.ne1.yahoo.com> Date: Mon, 20 May 2013 15:38:03 +0100 Message-ID: From: David House To: Dario Teixeira Cc: OCaml mailing-list Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQl814tOSoW0YfKpXMMvskSCXltqPQDYUE//nFekV0yhUpKSJuDzoWUVZ86T57Lc01bVKP6BKwq9pOXzNUNg+EfGLmrE+dCNqQEaLLwyiC1t7twhUCtmqh4z0TsN0OBMP5cOdtCXPiQwWPxjM+WI+VlsJ666Nw== Subject: Re: [Caml-list] The rec/nonrec debate At Jane Street we have a syntax extension that allows one to write "type nonrec t = ...". I too think that non-recursive is the right default. My argument is mostly as follows: it's nice to have nonrecursive values be the default, because shadowing is so useful. And it's confusing to have two different defaults for types and values. I also agree that we can't change this for ocaml. On 20 May 2013 15:31, Dario Teixeira wrote: > Hi, > > > 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/ > > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs