From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: What does "lacks a prefix" mean? Date: Tue, 14 Jul 2015 12:23:55 +0600 Message-ID: References: <1e0ad02f-ca3e-495c-bb85-61f77090d31d@googlegroups.com> <87bnfmqzn2.fsf@kuiper.lan.informatimago.com> <082e0be8-425b-4eff-8473-0c1091628695@default> <87d1zydu5g.fsf@nl106-137-147.student.uu.se> <54890979-2bf7-4665-b1d6-a147141c3dd1@default> <87pp3wkhoi.fsf@nl106-137-147.student.uu.se> <87lhej62nl.fsf@nl106-137-147.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1436855081 6767 80.91.229.3 (14 Jul 2015 06:24:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 14 Jul 2015 06:24:41 +0000 (UTC) To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 14 08:24:36 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 1ZEtdr-0003rk-OX for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Jul 2015 08:24:36 +0200 Original-Received: from localhost ([::1]:58115 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEtdr-00060p-1Y for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Jul 2015 02:24:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEtdb-0005wm-H0 for help-gnu-emacs@gnu.org; Tue, 14 Jul 2015 02:24:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEtda-0007DD-DZ for help-gnu-emacs@gnu.org; Tue, 14 Jul 2015 02:24:19 -0400 Original-Received: from mail-lb0-x234.google.com ([2a00:1450:4010:c04::234]:35393) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEtda-0007CZ-0v for help-gnu-emacs@gnu.org; Tue, 14 Jul 2015 02:24:18 -0400 Original-Received: by lblf12 with SMTP id f12so132619lbl.2 for ; Mon, 13 Jul 2015 23:24:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=kMgDZDk8v4rd2yaBV/H7nzymeTV8dNeelBKPfR8uoak=; b=a+E5RiHpaoIZqEciPAOPt4zRkLod13pty2+o1DV3SEnn1mPdvc95xKb9FM8aD7lHTk OXJKUU4C4SNDFGR7M9MTf8cquF6ejaV9tvp0nhjezBtlBNASpd/JbUbS0xoKmAtvfCgb 3Tue97mz9z6gUxIlHDbp1qQVPeezNZ3N8UDgq6p9xORZDoLgAAGbGaFbvFV6eLujoQ1b os+pU950xwqJzFXtEZ2yUHOrSftAEqqHdvRWzvaakE6WRDxL4qRW8t3S9c3JtjPoxmVP yaEcTnS03vw18OXYWfLhc9Fc32WVSfWfYQwy90OetkVqp9ISX8+nB/D3R3izz56x4iLQ 2XCA== X-Received: by 10.113.4.105 with SMTP id cd9mr30308363lbd.106.1436855055706; Mon, 13 Jul 2015 23:24:15 -0700 (PDT) Original-Received: by 10.25.8.202 with HTTP; Mon, 13 Jul 2015 23:23:55 -0700 (PDT) In-Reply-To: <87lhej62nl.fsf@nl106-137-147.student.uu.se> X-Google-Sender-Auth: OmuUtdn7ZaeAzO1It4aBzqcits4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::234 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:105712 Archived-At: On Tue, Jul 14, 2015 at 5:47 AM, Emanuel Berg wrot= e: > 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. > then doing > so will be helped to an unfathomable degree if the > "let* style" has been applied when the code was > originally written, as computation is stepwise > performed and each step is named and put neatly into > a nice looking column! > > It is, on the contrary, the "let style" with > > (let ((entity (computation_1 (computation_2 ( ... ))))) > ... ) > > which is much more difficult to write, not to mention > read, debug, and later maintain and modify. You=E2=80=99re putting out a strawman by comparing a =E2=80=9Clet* style=E2= =80=9D where small expressions are given names and arranged in a total order with a =E2=80=9Cl= et style=E2=80=9D where few names are bound to independent but huge expression= s. The ultimate degree of the =E2=80=9Clet*=E2=80=9D style you describe is cod= e compiled to assembly. (For the sake of argument, let=E2=80=99s assume a machine with ten thousand registers, so that we don=E2=80=99t have to argue about regist= er reuse.) Expressions are very simple but it becomes hard to give them meaningful names. Additionally, evey modern compiler worth its bits will interleave independent evaluations if it will help saturate the CPU pipelines. The resulting code is very complicated =E2=80=94 the code is doing several things at once and one has to unscramble it in order to reason about it. The ultimate degree of the =E2=80=9Clet style=E2=80=9D you describe is the = UNIX shell pipeline. Its two main problems are: (1) lack of names for intermediate values, (2) each unnamed intermediate value can only be used once. As soon as you want to reuse the result of a subexpression, you need to give it a name. As in most things, there is a golden middle where the expressions are not too complex, names are meaningful enough, and related computations are clustered together. When structured like this, code is a pleasure to work with. > "Variable dependencies" is all schoolbook stuff - > forget about it, the sooner the better, because it > doesn't work like that. It doesn't increase > "complexity", whatever that is. Schoolbook stuff? No, we were not taught about dependencies at school. We were taught recipes. Here is how you add, subtract, multiply and divide; this is how you use standard library functions; this is how you define your own functions. Oh actually in you can=E2=80=99t define your own functions; too bad, you=E2=80= =99ll have to make do with subroutines and instead of returning a result assign it into a global variable. This is where complexity comes from: people knowing recipes and applying them out of scale until the code is too complicated to fit in one head. Especially, code written by a person with an exceptionally big head will not fit in an average head. Maybe you can keep 15 named variables and 60 unnamed intermediate values in your head and reason about them freely. I cannot. I need devices that help me in that. These devices can be embedded in the code (meaningful names, auxiliary functions, and/or an occasional comment) or I can work it out on a sheet of paper, throw it away when done and have to redo it again the next time.