From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q03066PI026254 for ; Tue, 3 Jan 2012 01:06:06 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai4EAHJFAk9KfVI0kGdsb2JhbABCggWDCqdFCCIBAQEBCQkNBxQEIYFyAQEBBBICDx0BGx0BAwwGAwILDQICJgICIQEBEQEFARwGEwgaoAEKix1IgmuDeT+IcQIFC4EkiUqBFgSVAopvgw49g3s X-IronPort-AV: E=Sophos;i="4.71,446,1320620400"; d="scan'208";a="125343174" Received: from mail-ww0-f52.google.com ([74.125.82.52]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 03 Jan 2012 01:06:01 +0100 Received: by wgbdr12 with SMTP id dr12so31446163wgb.9 for ; Mon, 02 Jan 2012 16:06:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=oxZG8I+tv3tMljVQDnATEcukZWPYj2cA1vtjCBmFC00=; b=c9LIGJVBhuPTK1NriWEIaCljoQtCsCTP0az/EaJr/8ghnvxopQD2+tvE2tF6A3zX7n RoBEuo+ZsI2au2toQCbtQSlOEym4ayqCo6LtaIvwJAzUf+P6s7odf2cn9NP1DGzbIzxv x3FlD5YYhTqD64a5qGyn1Ra4ipcGvshWEFCeU= Received: by 10.227.206.10 with SMTP id fs10mr49872125wbb.13.1325549160358; Mon, 02 Jan 2012 16:06:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.180.3.202 with HTTP; Mon, 2 Jan 2012 16:05:39 -0800 (PST) In-Reply-To: References: From: Lukasz Stafiniak Date: Tue, 3 Jan 2012 01:05:39 +0100 Message-ID: To: Diego Olivier Fernandez Pons Cc: caml-list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id q03066PI026254 Subject: Re: [Caml-list] Examples where let rec is undesirable On Mon, Jan 2, 2012 at 11:37 PM, Diego Olivier Fernandez Pons wrote: >     List, > > I was wondering if there was any reason not to make "let rec" the default / > sole option, meaning cases where you clearly don't want a "let rec" instead > of "let" (only in functions, not cyclic data). > >          Diego Olivier The default "no-rec" allows for name recycling -- using the same name for an incrementally transformed value, i.e. to bind the intermediate results. Name recycling minimizes the cognitive burden: there are less names to remember in a scope, and differences in names are justified by differences in purpose of the values. Are there reasons to consider name recycling a bad style? Happy New Year, Łukasz