From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Robert Thorpe Newsgroups: gmane.emacs.help Subject: Re: What does "lacks a prefix" mean? Date: Sun, 19 Jul 2015 01:59:21 +0100 Message-ID: <87lhed0xp2.fsf@robertthorpeconsulting.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1437267588 15867 80.91.229.3 (19 Jul 2015 00:59:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 Jul 2015 00:59:48 +0000 (UTC) Cc: Yuri Khan To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 19 02:59:38 2015 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 1ZGcx6-0007bN-NO for geh-help-gnu-emacs@m.gmane.org; Sun, 19 Jul 2015 02:59:36 +0200 Original-Received: from localhost ([::1]:50236 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGcx5-0006iA-RW for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Jul 2015 20:59:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGcwx-0006hv-7W for help-gnu-emacs@gnu.org; Sat, 18 Jul 2015 20:59:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZGcwu-00010D-1a for help-gnu-emacs@gnu.org; Sat, 18 Jul 2015 20:59:27 -0400 Original-Received: from outbound-smtp01.blacknight.com ([81.17.249.7]:59195) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGcwt-0000zo-Ra for help-gnu-emacs@gnu.org; Sat, 18 Jul 2015 20:59:23 -0400 Original-Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp01.blacknight.com (Postfix) with ESMTPS id 2EF9898BA7 for ; Sun, 19 Jul 2015 00:59:22 +0000 (UTC) Original-Received: (qmail 8433 invoked from network); 19 Jul 2015 00:59:22 -0000 Original-Received: from unknown (HELO RTLaptop) (rt@robertthorpeconsulting.com@[86.163.21.0]) by 81.17.254.9 with ESMTPSA (DHE-RSA-AES128-SHA encrypted, authenticated); 19 Jul 2015 00:59:22 -0000 In-Reply-To: (message from Yuri Khan on Tue, 14 Jul 2015 12:23:55 +0600) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 81.17.249.7 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:105836 Archived-At: Yuri Khan writes: > On Tue, Jul 14, 2015 at 5:47 AM, Emanuel Berg wrote: > >> If you are to muck around with old code, which seldom >> is a good idea but sometimes necessary (?), > > Why the (?)? Mucking around with old code is necessary every time you > want to add a feature or debug a failure. For what it's worth, this is my opinion on let vs let*. When there's a dependency between two of the variables I use let*. If there's no dependency at all I use let. So, if the code defining y depends on the code defining x then I use let*. I don't like the style where let* is used for everything. Here's an example of the problem. Suppose you're reading through a function. You have a local variable z and you want to understand what values it could have. To begin with you want to understand what could happen at the beginning of the body of the let statement z is defined in. I.e.:- (defun foo () "blah blah" (let* ((a (something)) (b (something-else ...)) (z (something-more))) ... here... ...rest of the code...) Now, let's say the programmer has used let. In that case I know by looking that I don't have to read the definitions of a & b. Alternatively, suppose the programmer has used let* even though z isn't dependent on a or b. In that case let* indicates to me the reader that they should read the definitions of a & b. But, doing that isn't immediately necessary, I may not need to understand the details of a & b to understand the problem. It's easy to be critical of the process of restructuring or refactoring code. It's inevitable in large codebases though. The cost and time of rewriting them is simply too large. Even if the original is badly written it generally contains undocumented features that people rely on. If a large program is well written that doesn't mean it won't need modifications regularly. BR, Robert Thorpe