From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Always using let* Date: Sun, 14 Sep 2014 14:25:30 -0700 (PDT) Message-ID: <93faab1c-96bd-4188-9686-3869fc027601@default> References: <87fvfukmso.fsf@Equus.decebal.nl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1410729974 29908 80.91.229.3 (14 Sep 2014 21:26:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Sep 2014 21:26:14 +0000 (UTC) To: Cecil Westerhof , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Sep 14 23:26:07 2014 Return-path: Envelope-to: geh-help-gnu-emacs@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 1XTHJ7-00086q-Sk for geh-help-gnu-emacs@m.gmane.org; Sun, 14 Sep 2014 23:26:06 +0200 Original-Received: from localhost ([::1]:56296 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTHJ7-0004GX-DF for geh-help-gnu-emacs@m.gmane.org; Sun, 14 Sep 2014 17:26:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTHIp-0004GD-0L for help-gnu-emacs@gnu.org; Sun, 14 Sep 2014 17:25:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTHIg-00066j-9d for help-gnu-emacs@gnu.org; Sun, 14 Sep 2014 17:25:46 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:38249) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTHIf-00066a-Lg for help-gnu-emacs@gnu.org; Sun, 14 Sep 2014 17:25:37 -0400 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s8ELPXMP009483 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 14 Sep 2014 21:25:34 GMT Original-Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s8ELPWr4028990 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 14 Sep 2014 21:25:33 GMT Original-Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s8ELPVha029457; Sun, 14 Sep 2014 21:25:32 GMT In-Reply-To: <87fvfukmso.fsf@Equus.decebal.nl> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:99886 Archived-At: > Would it be OK to always use let*? I was just bitten by the fact > that with let you can not previous variables from the let statement, > as is possible with setq. So I am thinking about always using let*, > so I do not have to think about it. Or are there good reasons to use > let when you do not need let*? The most common reason is when you want to use a variable value in the cadr of a binding and you do *not* want to pick up the variable's newly bound value. IOW, precisely the opposite use case of what you wanted when you were bit. (setq c 3) (let ((c (+ c 4)) (b (* c 42))) ; Use original C value: 3 ...) (The other reason is that for some Lisps the bindings of `let' can be done in parallel, which can be quicker.)