all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>,
	Christopher Dimech <dimech@gmx.com>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: RE: [External] : Supplying DOC string in a `defun' using `defvar'
Date: Wed, 2 Jun 2021 15:53:31 +0000	[thread overview]
Message-ID: <CO1PR10MB446676A5E538EBDC44B6D766F33D9@CO1PR10MB4466.namprd10.prod.outlook.com> (raw)
In-Reply-To: <jwvlf7sfmbw.fsf-monnier+emacs@gnu.org>

> > From my point of view, the docstring should have 
> > nothing to do with either dynamic or lexical binding.
> 
> No, but

I guess (hope) that your "No, but" really means "Yes,
but", and that you agree that it _should_ indeed have
nothing to do with dynamic or lexical binding.

> it's a new language feature, so it makes sense that 
> you need to use the new dialect for it be available.

I don't see how that makes sense at all.  It doesn't
follow logically that every "new language feature"
must work _only_ with the lexical binding dialect
turned ON.

As you say, the "lexical" dialect supports both
lexical and dynamic binding.

And other things being equal, a new feature should,
likewise, support both lexical and dynamic binding.

But it doesn't follow that a new feature shouldn't
work with the "dynamic" dialect, when no lexical
bindings are involved.

Regardless of the "dialect" used (i.e., whether
var `lexical-binding' is nil or non-nil), there's
nothing in the example used in this thread that
makes use of any lexical bindings (beyond the
binding of local variable `x'):

 (defvar my-doc "Whatever...")	
 (defun my-fun (x)
   (:documentation my-doc)
   (+ x 42))

That lexical binding is available in Emacs Lisp now
is a good thing.  That both it and dynamic binding
should be available from now on is a good thing.
And turning on such support for both by default will
also be a good thing, when that happens.

But that users should be required to explicitly turn
it on now in a buffer where you evaluate such an
example (which shouldn't need and doesn't make use
of lexical bindings) makes no sense at all, to me.
But please let me know what I'm missing about this.

At least such a requirement doesn't follow from
the fact that `:documentation' is "a new language
feature" ... unless you can show that this new
feature somehow requires lexical binding support
even for such an example.

The question, I think, is why shouldn't using
`:documentation' work regardless of whether lexical
binding is turned on for the current buffer?

> You get to choose for every ELisp file which
> dialect it uses.

Emacs turning on the "lexical" dialect (a misnomer)
by default, so that both lexical and binding are
supported out of the box, will be welcome.

Until then, "get to choose" should really mean
_get_ to choose.  It shouldn't mean that in order
to use such a "new feature" you _must_ explicitly
turn on the "lexical" dialect, even when no lexical
binding is involved.

For now, the default is the "dynamic" dialect (also
a misnomer, as you pointed out).  For now, new
features that don't inherently require the use of
lexical binding should _just work_ for both
"dialects".

Unless I'm missing something...  Does this new
feature (`:documentation') inherently require the
"lexical" dialect?  Is such an example, which
makes no use of lexical bindings, inherently
incompatible with the "dynamic" dialect?



  parent reply	other threads:[~2021-06-02 15:53 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-31 23:00 Supplying DOC string in a `defun' using `defvar' ludvig-faddeev
2021-05-31 23:11 ` 2QdxY4RzWzUUiLuE
2021-05-31 23:13 ` Jean Louis
2021-05-31 23:32   ` ludvig-faddeev
2021-05-31 23:43     ` Jean Louis
2021-06-01  0:14   ` 2QdxY4RzWzUUiLuE
2021-06-01  0:23     ` Jean Louis
2021-06-01  0:35       ` Jean Louis
2021-06-01  0:40       ` Michael Heerdegen
2021-06-01  1:00         ` ludvig-faddeev
2021-06-01  1:07         ` Jean Louis
2021-06-01  1:28           ` Michael Heerdegen
2021-06-01  1:33             ` Jean Louis
2021-06-01 13:39               ` Michael Heerdegen
2021-06-01 16:31                 ` Jean Louis
2021-06-01 22:44                   ` Michael Heerdegen
2021-06-01  3:26   ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-06-01  5:19     ` Christopher Dimech
2021-06-01 14:31       ` Michael Heerdegen
2021-06-01 14:41         ` Christopher Dimech
2021-06-01 15:01           ` [External] : " Drew Adams
2021-06-01 15:05             ` Christopher Dimech
2021-06-01 15:38               ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-06-01 18:20                 ` Christopher Dimech
2021-06-01 18:25                   ` Eli Zaretskii
2021-06-01 18:33                     ` Christopher Dimech
2021-06-02  2:53                   ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-06-02 22:46                   ` Michael Heerdegen
2021-06-02 22:56                     ` Christopher Dimech
2021-06-03  6:52                       ` Jean Louis
2021-06-03  7:23                         ` Eduardo Ochs
2021-06-03  9:19                           ` Jean Louis
2021-06-03 14:17                             ` Eduardo Ochs
2021-06-02 15:59                 ` FW: " Drew Adams
2021-06-02 16:19                   ` Christopher Dimech
2021-06-02 17:24                     ` Drew Adams
2021-06-02 18:14                       ` Christopher Dimech
2021-06-01 22:39               ` Michael Heerdegen
2021-06-01 22:43                 ` Christopher Dimech
2021-06-02  2:55                   ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-06-02  4:55                     ` Christopher Dimech
2021-06-02  5:06                       ` Jean Louis
2021-06-02 13:09                       ` Stefan Monnier
2021-06-02 13:35                         ` Christopher Dimech
2021-06-02 14:43                           ` Christopher Dimech
2021-06-02 15:08                           ` Stefan Monnier
2021-06-02 16:14                             ` Christopher Dimech
2021-06-02 15:53                         ` Drew Adams [this message]
2021-06-02 18:35                           ` Stefan Monnier
2021-06-02 18:59                             ` Jean Louis
2021-06-02 19:55                               ` Drew Adams
2021-06-02 19:58                             ` Drew Adams
2021-06-02 21:26                               ` Stefan Monnier
2021-06-02 22:24                                 ` Drew Adams
2021-06-02 22:39                                   ` Stefan Monnier
2021-06-02 22:52                                     ` Christopher Dimech
2021-06-02 23:11                                       ` Stefan Monnier
2021-06-03 10:57                                         ` Christopher Dimech
2021-06-03 13:43                                         ` Christopher Dimech
2021-06-03 15:10                                           ` Stefan Monnier
2021-06-03 15:34                                             ` Christopher Dimech
2021-06-03 15:46                                               ` Stefan Monnier
2021-06-03 16:18                                                 ` Christopher Dimech
2021-06-03  6:29                                     ` Jean Louis
2021-06-03  6:22                                 ` Eli Zaretskii
2021-06-03  6:59                                   ` Lars Ingebrigtsen
2021-06-01 15:46             ` Drew Adams
2021-06-01 16:34         ` Jean Louis
2021-06-01 18:51       ` Nick Dokos
2021-06-01 19:02         ` Christopher Dimech
2021-06-01 22:15           ` Robert Thorpe
2021-06-01 23:08             ` Christopher Dimech
2021-05-31 23:20 ` [External] : " Drew Adams
2021-05-31 23:31   ` Michael Heerdegen
2021-05-31 23:46     ` ludvig-faddeev
2021-06-01  0:29       ` Michael Heerdegen
2021-06-01  0:35         ` ludvig-faddeev
2021-06-01  1:08           ` Michael Heerdegen
2021-06-01  1:49             ` ludvig-faddeev
2021-06-01 14:26               ` Michael Heerdegen
2021-06-01 21:50                 ` ludvig-faddeev
2021-06-01 22:22                   ` Michael Heerdegen
2021-05-31 23:40   ` Jean Louis

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=CO1PR10MB446676A5E538EBDC44B6D766F33D9@CO1PR10MB4466.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=dimech@gmx.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.