From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Rusi Newsgroups: gmane.emacs.help Subject: Re: using setq to create lists based on other lists... Date: Mon, 3 Dec 2018 05:43:29 -0800 (PST) Message-ID: References: <5C1642CD-F485-47CF-88B9-41D7960DDE80@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1543844618 5634 195.159.176.226 (3 Dec 2018 13:43:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 3 Dec 2018 13:43:38 +0000 (UTC) Injection-Date: Mon, 03 Dec 2018 13:43:29 +0000 User-Agent: G2/1.0 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 03 14:43:33 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gToVZ-0001Km-0J for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Dec 2018 14:43:33 +0100 Original-Received: from localhost ([::1]:48565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gToXf-00066G-8w for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Dec 2018 08:45:43 -0500 X-Received: by 2002:a0c:b7a8:: with SMTP id l40mr12548063qve.4.1543844609985; Mon, 03 Dec 2018 05:43:29 -0800 (PST) X-Received: by 2002:a37:1251:: with SMTP id c78mr212381qkh.1.1543844609810; Mon, 03 Dec 2018 05:43:29 -0800 (PST) Original-Path: usenet.stanford.edu!v55no213274qtk.0!news-out.google.com!m21ni6851qta.0!nntp.google.com!v55no213263qtk.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Original-Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=117.222.1.249; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui Original-NNTP-Posting-Host: 117.222.1.249 Original-Xref: usenet.stanford.edu gnu.emacs.help:224713 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:118842 Archived-At: On Sunday, December 2, 2018 at 9:11:15 PM UTC+5:30, Jean-Christophe Helary = wrote: > > On Dec 3, 2018, at 0:07, Stefan Monnier wrote: > >=20 > > Here's another take on it: > >=20 > >> If you do > >> (setcar list0 0) > >=20 > > Why? Just don't use setcar/setcdr! That one line is succinct no doubt! Do you think its really comprehensible? >=20 > Lovely :) >=20 > When I check "Modifying Existing List Structure" the only things I find o= f any use in my case are setcar/setcdr. >=20 > >> There are probably better ways to create lists based on other lists wi= thout > >> "linking" the two, so I'd like some information about that. > >=20 > > The better way is to not modify the lists, so you're not affected by > > whether they're linked or not. >=20 > I would certainly have considered that if I had known that setq was linki= ng the lists :) And thats what I mean: "Lovely" =E2=87=8F "Understood"! More generally assignment =E2=89=A0 mutation, especially in latent language= s like lisp/python By coincidence I was working on a sequel to my blog post: http://blog.languager.org/2012/10/functional-programming-lost-booty.html Out there I had tried to say: functional programming has nice *features* th= at=20 may be used without using functional *languages* Over time I am coming to see that there is an imbalance in the view in that= post=E2=80=A6 Niklaus Wirth said: The most important choices that a language designer mak= es is what to leave out Yeah that sounds like classical religious morality =E2=80=94 the good perso= n is the one who has/enjoys/etc less. And that is true =E2=80=94 when programmers stopped =E2=80=98enjoying=E2=80= =99 interrupts, registers, etc we moved from assembly to (what was then called) hi-level programming The same is true for FPLs =E2=80=94 how to become more powerful by having l= ess powerful languages?? Here is my (as yet unfilled out) org ode list of these "impoverishments that are enrichments" Yeah they are probably not comprehensible as yet For now I will just say that the second and third points are different: assignment changes *variables*; mutability changes *constants* (setq is assignment; set-car is mutation) * Print Statement * Assignment * Mutability * Pass-by malarchy * Expressions AND Statements Syntax * Void function * Expressions AND Statements Semantics * General typeless statement construction * OOP (inheritance) [My reason for posting this yet: Are there other unnecessarys of imperative= /OO programming that are 'irrelevantized' and thence removed in FPLS? Would be interested to hear=E2=80=A6 Sorry to Jean-Christophe if that is not very helpful Here are my FP posts, admittedly mostly language neutral http://blog.languager.org/search/label/FP