unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Emanuel Berg <incal@dataswamp.org>,
	"help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: RE: [External] : Re: Printing alist pairs to a dedicated buffur
Date: Thu, 25 Apr 2024 15:55:36 +0000	[thread overview]
Message-ID: <SJ0PR10MB54883FAC3D2870795A94CD14F3172@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <87jzkss5w8.fsf@dataswamp.org>

> Don't use `defvar' if it can be avoided
> as that creates global dynamic/special
> variables,

By that logic, don't use defun because
it creates global dynamic functions.

Or defadvice or defalias or defcustom
or defconst or defface or defgeneric or
defgroup or defmacro or defmethod or
defstruct or deftheme or ...  They all
create global, dynamic bindings.

Try to use Emacs (or Haskell or ...
pretty much anything else, for that
matter) without using global, dynamic
bindings.  Then tell us about your
adventure. ;-)

It _can_ be "avoided" entirely.  But no
one does so.

> `setq' creates global static/lexical variables

Not true.

This is what CLTL2 says about setq in Common
Lisp, which uses lexical binding by default,
for variables:

  "The variables are represented as symbols, 
   of course, and are interpreted as 
   referring to static or dynamic instances 
   according to the usual rules. Therefore 
   setq may be used for assignment of both 
   lexical and special variables."

https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node79.html

And Elisp isn't even "as lexical" as Common
Lisp yet.  As (elisp) "Scoping Rules for
Variable Bindings" says:

  "By default, the local bindings that Emacs 
   creates are "dynamic bindings".
   ...
   The dynamic binding was (and still is)
   the default in Emacs for many years, but 
   lately Emacs is moving towards using 
   lexical binding in more and more places, 
   with the goal of eventually making that 
   the default."

IOW, Elisp hopes to eventually do what Common
Lisp does - and has done - for 40 years.



  parent reply	other threads:[~2024-04-25 15:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19 12:57 Printing alist pairs to a dedicated buffur Heime
2024-04-19 13:24 ` Manuel Giraud via Users list for the GNU Emacs text editor
2024-04-19 19:26   ` Heime
2024-04-19 19:42     ` Heime
2024-04-20  9:55       ` Manuel Giraud via Users list for the GNU Emacs text editor
2024-04-20 10:08         ` Emanuel Berg
2024-04-25 11:13           ` Heime
2024-04-26  0:27             ` Emanuel Berg
2024-04-25 15:55           ` Drew Adams [this message]
2024-04-25 16:18             ` [External] : " Heime
2024-04-25 22:43               ` Emanuel Berg
2024-04-25 22:29             ` Emanuel Berg
2024-04-25 23:38               ` Drew Adams
2024-04-26  0:03                 ` Emanuel Berg
2024-04-26 15:55                   ` Drew Adams
2024-04-26 16:57                     ` Heime
2024-04-26 17:27                       ` Yuri Khan
2024-04-27 22:20                         ` Heime
2024-04-26  0:41                 ` Emanuel Berg
2024-04-26  1:08                 ` Emanuel Berg
2024-04-20 16:37         ` Heime
2024-04-20 17:23           ` Heime
2024-04-20 20:48             ` Yuri Khan

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=SJ0PR10MB54883FAC3D2870795A94CD14F3172@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=incal@dataswamp.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).