From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Lexical let and setq Date: Sun, 15 Sep 2013 01:11:38 -0400 Message-ID: References: <871u51ll93.fsf@yandex.ru> <0b29ebee-8ed4-47e2-816b-910a013a0898@default> <878uz0e02m.fsf_-_@maru2.md5i.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1379221907 18017 80.91.229.3 (15 Sep 2013 05:11:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 15 Sep 2013 05:11:47 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 15 07:11:50 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VL4cf-0008MF-3k for ged-emacs-devel@m.gmane.org; Sun, 15 Sep 2013 07:11:49 +0200 Original-Received: from localhost ([::1]:55414 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VL4ce-00079i-Es for ged-emacs-devel@m.gmane.org; Sun, 15 Sep 2013 01:11:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VL4cV-00079V-3o for emacs-devel@gnu.org; Sun, 15 Sep 2013 01:11:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VL4cN-0002xE-Q9 for emacs-devel@gnu.org; Sun, 15 Sep 2013 01:11:39 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:18169) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VL4cN-0002xA-LH for emacs-devel@gnu.org; Sun, 15 Sep 2013 01:11:31 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFG4rxBo/2dsb2JhbABEvw4Xc4IeAQEEAVYoCws0EhQYDYhCBsEtjWGDKQOkeoFegxM X-IPAS-Result: Av4EABK/CFG4rxBo/2dsb2JhbABEvw4Xc4IeAQEEAVYoCws0EhQYDYhCBsEtjWGDKQOkeoFegxM X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="27849452" Original-Received: from 184-175-16-104.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([184.175.16.104]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 15 Sep 2013 01:07:52 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 87EF0AE29B; Sun, 15 Sep 2013 01:11:38 -0400 (EDT) In-Reply-To: (Lars Magne Ingebrigtsen's message of "Sat, 14 Sep 2013 13:13:32 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:163353 Archived-At: > I think the most common reason for stashing a lot of variables in a let > is to avoid infinite indentation. > (let ((a (foo))) > (something) > (let ((b (something-else))) > (more a b) > (let ((c (yet-more))) > (zot a b c)))) > vs > (let ((a (foo)) > b c) > (something) > (setq b (something-else)) > (more a b) > (setq c (yet-more)) > (zot a b c)) > I kinda think the latter form is sometimes more readable. In SML (where `setq' is not an option), the natural way to write it is equivalent to: (let* ((a (foo)) (_ (something)) (b (something-else)) (_ (more a b)) (c (yet-more))) (zot a b c)) -- Stefan