all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Rusi <rustompmody@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: using setq to create lists based on other lists...
Date: Mon, 3 Dec 2018 05:43:29 -0800 (PST)	[thread overview]
Message-ID: <f1c35d37-3842-459a-b04c-3d1f7e5a3399@googlegroups.com> (raw)
In-Reply-To: <mailman.5028.1543765273.1284.help-gnu-emacs@gnu.org>

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:
> > 
> > Here's another take on it:
> > 
> >> If you do
> >> (setcar list0 0)
> > 
> > Why?  Just don't use setcar/setcdr!

That one line is succinct no doubt! Do you think its really comprehensible?

> 
> Lovely :)
> 
> When I check "Modifying Existing List Structure" the only things I find of any use in my case are setcar/setcdr.
> 
> >> There are probably better ways to create lists based on other lists without
> >> "linking" the two, so I'd like some information about that.
> > 
> > The better way is to not modify the lists, so you're not affected by
> > whether they're linked or not.
> 
> I would certainly have considered that if I had known that setq was linking the lists :)

And thats what I mean: "Lovely" ⇏ "Understood"!

More generally assignment ≠ mutation, especially in latent languages 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* that 
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…

Niklaus Wirth said: The most important choices that a language designer makes
is what to leave out
Yeah that sounds like classical religious morality — the good person is the one
who has/enjoys/etc less.
And that is true — when programmers stopped ‘enjoying’ interrupts, registers, etc
we moved from assembly to (what was then called) hi-level programming

The same is true for FPLs — how to become more powerful by having less 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…

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


  parent reply	other threads:[~2018-12-03 13:43 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-02 10:53 using setq to create lists based on other lists Jean-Christophe Helary
2018-12-02 15:07 ` Stefan Monnier
2018-12-02 15:41   ` Jean-Christophe Helary
2018-12-02 16:05     ` Stefan Monnier
2018-12-02 16:23       ` Jean-Christophe Helary
2018-12-02 17:02         ` Stefan Monnier
2018-12-02 17:21           ` Jean-Christophe Helary
2018-12-02 19:11             ` Robert Thorpe
2018-12-02 23:44               ` Jean-Christophe Helary
     [not found]   ` <mailman.5028.1543765273.1284.help-gnu-emacs@gnu.org>
2018-12-03 13:43     ` Rusi [this message]
     [not found] <mailman.5010.1543748027.1284.help-gnu-emacs@gnu.org>
2018-12-02 11:21 ` Barry Margolin
2018-12-02 11:51   ` Stephen Berman
2018-12-02 12:22     ` Jean-Christophe Helary
2018-12-02 13:08       ` Stephen Berman
2018-12-02 13:28         ` Jean-Christophe Helary
2018-12-02 14:40           ` Michael Heerdegen
2018-12-02 15:34             ` Jean-Christophe Helary
2018-12-02 15:44               ` Michael Heerdegen
2018-12-02 15:57                 ` Jean-Christophe Helary
2018-12-02 15:00           ` Stephen Berman
2018-12-02 15:30             ` Jean-Christophe Helary
     [not found]             ` <mailman.5026.1543764670.1284.help-gnu-emacs@gnu.org>
2018-12-04  9:00               ` Barry Margolin
2018-12-02 12:03   ` Jean-Christophe Helary
     [not found] <mailman.5042.1543777897.1284.help-gnu-emacs@gnu.org>
2018-12-04  9:04 ` Barry Margolin
     [not found]   ` <(message>
     [not found]     ` <from>
     [not found]       ` <Barry>
     [not found]         ` <Margolin>
     [not found]           ` <on>
     [not found]             ` <Tue>
     [not found]               ` <04>
     [not found]                 ` <Dec>
     [not found]                   ` <2018>
     [not found]                     ` <04:04:52>
2018-12-04 13:56   ` Stefan Monnier
2018-12-05  1:07   ` Robert Thorpe
2018-12-05  2:32     ` Drew Adams
2018-12-05  6:45       ` Jean-Christophe Helary
2018-12-05  8:00         ` Marcin Borkowski
2018-12-05  8:11           ` Jean-Christophe Helary
2018-12-05 14:57         ` Drew Adams
     [not found]         ` <mailman.5218.1544021892.1284.help-gnu-emacs@gnu.org>
2018-12-05 16:59           ` Barry Margolin
     [not found]     ` <mailman.5186.1543978155.1284.help-gnu-emacs@gnu.org>
2018-12-05 16:50       ` Barry Margolin
     [not found]   ` <mailman.5145.1543931778.1284.help-gnu-emacs@gnu.org>
2018-12-05 16:47     ` Barry Margolin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f1c35d37-3842-459a-b04c-3d1f7e5a3399@googlegroups.com \
    --to=rustompmody@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.