all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: [External] : Re: Printing alist pairs to a dedicated buffur
Date: Fri, 26 Apr 2024 02:03:59 +0200	[thread overview]
Message-ID: <87msph9ehc.fsf@dataswamp.org> (raw)
In-Reply-To: SJ0PR10MB5488AFCE4587111F25A59DEFF3172@SJ0PR10MB5488.namprd10.prod.outlook.com

Drew Adams wrote:

> That just shows that most Elisp files provided with Emacs
> have `lexical-binding' = t.

Yes - most :)

> Dynamic binding is still the default in Elisp. The doc is
> correct about that.

Yes, but isn't that a practical measure so that legacy code
won't break? Optimally all files will have the "-*-
lexical-binding: t -*-" directive first, then lexical binding
can be the default and that line won't be needed.

After that one can have the advantages of lexical binding in
general but one can still have dynamic/special variables for
options and other possible use cases, so there is no loss in
that respect.

There are also some interesting border cases where the
endpoints seems to meat, for example this

;; Provide an easy hook to tell if we are running with floats or not.
;; Define pi and e via math-lib calls (much less prone to killer typos).
(defconst float-pi (* 4 (atan 1)) "The value of Pi (3.1415926...).")
(with-suppressed-warnings ((lexical pi))
  (defconst pi float-pi
    "Obsolete since Emacs-23.3.  Use `float-pi' instead."))
(make-obsolete-variable 'pi 'float-pi "23.3")
(internal-make-var-non-special 'pi)

Lines 28-35 in
/usr/local/share/emacs/30.0.50/lisp/emacs-lisp/float-sup.el

Yeah, what should one make of it?

But now the discussion is about dynamic vs lexical scope, what
I said refered to global variables. Why have them with
`defvar', and why have them with `setq'? Often there is no
need for them to be global, that just creates problems.

-- 
underground experts united
https://dataswamp.org/~incal




  reply	other threads:[~2024-04-26  0:03 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           ` [External] : " Drew Adams
2024-04-25 16:18             ` 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 [this message]
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

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

  git send-email \
    --in-reply-to=87msph9ehc.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --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.