all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: steve-humphreys@gmx.com
To: Joost Kremers <joostkremers@fastmail.fm>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Understanding the "let" construct and the setting of variables
Date: Thu, 17 Dec 2020 09:43:30 +0100	[thread overview]
Message-ID: <trinity-d74515d5-16ba-4b28-a7df-932aa5fe68b9-1608194610119@3c-app-mailcom-bs11> (raw)
In-Reply-To: <87o8is26nu.fsf@fastmail.fm>



> Sent: Thursday, December 17, 2020 at 9:10 AM
> From: "Joost Kremers" <joostkremers@fastmail.fm>
> To: steve-humphreys@gmx.com
> Cc: help-gnu-emacs@gnu.org
> Subject: Re: Understanding the "let" construct and the setting of variables
>
>
> On Thu, Dec 17 2020, steve-humphreys@gmx.com wrote:
> > Finally I got some useful information (ielm).  Fantastic.
> >
> > ACCEPTED: Running function has created a global variable `tim` (plus all the other
> > variables you've setq'ed), and since there are no packages or namespaces in
> > Elisp, your variable is now available to all of Emacs.
> >
> > QUESTION: What happens if one does a "setq" on a variable defined in the binding part of the
> > "let"? Can one do that?
>
> Yes, inside the body of the `let`, you can.
>
> > QUESTION: What goes in the body of a "let"?  I would think I can use the variables defined within
> > the binding section of "let".
>
> Yes.
>
> > QUESTION: Can one update a variable in the body of the "let" (the variable being defined within
> > the binding section of "let").
>
> Yes, with `setq`.

My mistake was that I was trying the variables using (myvar value) in the body of "let", the
same way I was doing in the binding part.  That was what confused me when others iterated that
"setq" makes the variables available ta all of emacs.

This gets me to "defvar".  I have read that "setq" does net actually
make a variable.  It is defvar that makes a variable available.
When reading the "Intro to Emacs Lisp", the focus is on using "setq".

Do the question really is this.  What happens when one sets an object with "setq"
if elisp does not make a variable from the name?


> --
> Joost Kremers
> Life has its moments
>
>



  reply	other threads:[~2020-12-17  8:43 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17  0:10 Understanding the "let" construct and the setting of variables steve-humphreys
2020-12-17  0:21 ` Joost Kremers
2020-12-17  2:08   ` steve-humphreys
2020-12-17  3:12     ` steve-humphreys
2020-12-17  8:01       ` Joost Kremers
2020-12-17  8:31         ` steve-humphreys
2020-12-17  8:50           ` Joost Kremers
2020-12-17  8:10     ` Joost Kremers
2020-12-17  8:43       ` steve-humphreys [this message]
2020-12-17  8:56         ` Joost Kremers
2020-12-18 20:48           ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-18 20:46         ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-18 21:07           ` Jean Louis
2020-12-18 22:31           ` tomas
2020-12-18 20:39       ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-17  2:49   ` steve-humphreys
2020-12-17  7:58     ` Joost Kremers
2020-12-17 16:55       ` Drew Adams
2020-12-17 20:11         ` steve-humphreys
2020-12-17 21:57           ` Drew Adams
2020-12-17 22:35           ` Michael Heerdegen
2020-12-18  9:01             ` tomas
2020-12-18  9:16               ` Michael Heerdegen
2020-12-18 20:55                 ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-19  2:17                   ` Michael Heerdegen
2020-12-19  2:52                     ` Drew Adams
2020-12-19  5:15                     ` Stefan Monnier
2020-12-18 20:33   ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-17  0:25 ` steve-humphreys
2020-12-17  0:35   ` steve-humphreys
2020-12-17  1:05     ` Joost Kremers
2020-12-17  1:20       ` steve-humphreys
2020-12-18 20:58         ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-17  4:34   ` Jean Louis
2020-12-17  5:12     ` steve-humphreys
2020-12-19  6:06       ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-17  7:31     ` steve-humphreys
2020-12-19  5:55     ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-19  6:49       ` Jean Louis
2020-12-20  5:19         ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-18 17:14   ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-18 17:48     ` tomas
2020-12-18 15:33 ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-18 18:12   ` Jean Louis
2020-12-18 18:20     ` Drew Adams
2020-12-18 18:45       ` Jean Louis
2020-12-18 19:16         ` Drew Adams
2020-12-18 20:00           ` Jean Louis
2020-12-18 21:27     ` Christopher Dimech
2020-12-19  6:23     ` Emanuel Berg via Users list for the GNU Emacs text editor

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=trinity-d74515d5-16ba-4b28-a7df-932aa5fe68b9-1608194610119@3c-app-mailcom-bs11 \
    --to=steve-humphreys@gmx.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=joostkremers@fastmail.fm \
    /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.