From: Alan Mackenzie <acm@muc.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Distinguishing `consp` and `functionp`
Date: Sat, 27 Jan 2024 23:01:57 +0000 [thread overview]
Message-ID: <ZbWLZWfLAnBGdIMN@ACM> (raw)
In-Reply-To: <jwv34uikggs.fsf-monnier+emacs@gnu.org>
Hello, Stefan.
On Sat, Jan 27, 2024 at 09:25:10 -0500, Stefan Monnier wrote:
> >> I've been annoyed at the use of lists to represent function values for
> >> a while now.
> > Why? Lists are the natural representation, and traditional in Lisp.
> > They bring all sorts of advantages (like being able to manipulate code
> > easily in Lisp).
> Not sure how that relates. When the code is byte-compiled we already
> can't access the function as a plain list. And when it's native
> compiled, we literally can't access its internals from Lisp. at all.
Evasive non-answer number 1. We're not talking about byte or native
compiled forms. We're talking about interpreted forms. The advantages
of Lisp forms had to be foregone in the compiled forms to optimise
performance. But when being able to manipulate forms is more important
than speed, then the interpreted forms are used. Your plan will make
this more difficult.
Let me repeat, lists are the natural, traditional representation in
Lisp, which bring all sorts of advantages. Your proposal will reduce
these advantages. For what gain?
> > Blunder? Having (closure ...) alongside (lambda ...) is an
> > inconvenience, yes, but ... Why a "blunder"?
> Because we could have easily used #[closure ...] instead and the problem
> would be mostly solved by now :-)
Evasive non-answer number 2. What is the advantage of #[closure ...]
over (closure ...)? I can see only disadvantages.
> > Please don't do that. If you must invent a new form, then invent a new
> > symbol to signify it. Misusing #[...] will lead to problems and extra
> > work for everybody (as, for example, using the doc string field in
> > oclosures for something else has led to extra work).
> Actually, if you look at the patch, you'll see that the change tends to
> reduces the amount of work that's needed elsewhere because docstrings
> and interactive-forms are now found at the same place for interpreted
> and (byte-)compiled functions.
Evasive non-answer number 3. Where in the new structure you put the
components is independent of the symbol you use. My point wasn't about
the patch as a whole, it was about the symbol to be used for your new
form. If you press ahead with this abuse of #[...] it means that every
time somebody wants to check for a byte compiled form, they'll
additionally have to check its innards. #[ ... ] currently has an
unambiguous meaning, and it should stay that way.
> > Any packages out there that deal with the internal format of Lisp code
> > will be severely affected.
> Don't know about "severely", but yes they may be affected. There really
> aren't vry many of them, tho.
Not "may" but "will". This is an important point, not something to be
brushed aside and ignored. Work on the Emacs core will be affected,
too.
> > For example, my amendments for bug #67455 (Putting position information
> > into doc strings) are already difficult enough.
> I'll gladly take care of making the necessary adjustements.
That's just an example to make a point. _ALL_ similar work on the core
will become more difficult if you press ahead with this change.
> > This change would add a whole new layer of indirection into bug
> > #67455's changes.
> I don't see how/why.
Isn't it obvious? In place of being able to work on the Lisp form, one
will first have to extract it from the new structure, and then
afterwards write it back to that structure. What M-: (symbol-function
'foo) currently does will, I think, become more tedious to do. That is
the extra layer of indirection.
> In the worst case, it will replace one special case with another.
No. It will just make things more difficult, full stop. Or can you
identify something in your change which will make development easier?
Again, why? What is the advantage this proposal of yours is supposed to
bring? So far, all I've seen in the thread is tiny things about the
ability to do (funcall '(lambda ...)), the ability to cl-prin1 functions
obfuscated and suchlike. Why?
> Stefan
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2024-01-27 23:01 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-25 23:15 Distinguishing `consp` and `functionp` Stefan Monnier
2024-01-26 0:00 ` Adam Porter
2024-01-26 0:24 ` Stefan Monnier
2024-01-26 7:31 ` Eli Zaretskii
2024-01-26 19:22 ` João Távora
2024-01-26 21:13 ` Stefan Monnier
2024-01-26 21:50 ` João Távora
2024-01-26 23:55 ` Stefan Monnier
2024-01-27 0:22 ` Daniel Mendler via Emacs development discussions.
2024-01-27 11:47 ` João Távora
2024-01-27 13:20 ` Po Lu
2024-01-27 11:53 ` João Távora
2024-01-28 3:03 ` Richard Stallman
2024-01-28 21:27 ` Stefan Monnier
2024-01-29 12:45 ` Eli Zaretskii
2024-01-29 15:19 ` Stefan Monnier
2024-01-29 15:31 ` Eli Zaretskii
2024-01-29 15:41 ` Stefan Monnier
2024-01-29 15:46 ` Eli Zaretskii
2024-01-29 15:48 ` Stefan Monnier
2024-01-29 15:54 ` João Távora
2024-01-29 16:10 ` Eli Zaretskii
2024-01-29 16:25 ` João Távora
2024-01-29 16:10 ` Eli Zaretskii
2024-01-29 16:17 ` Andreas Schwab
2024-01-29 16:34 ` João Távora
2024-02-01 3:49 ` Richard Stallman
2024-01-29 16:28 ` Stefan Monnier
2024-01-29 16:34 ` João Távora
2024-01-29 20:00 ` Stefan Monnier
2024-01-30 8:58 ` João Távora
2024-01-30 12:54 ` Stefan Monnier
2024-01-30 22:24 ` João Távora
2024-01-30 23:13 ` Stefan Monnier
2024-01-30 23:43 ` João Távora
2024-01-31 0:22 ` Stefan Monnier
2024-01-31 0:40 ` João Távora
2024-01-31 3:37 ` Stefan Monnier
2024-01-31 10:51 ` João Távora
2024-01-31 18:34 ` Stefan Monnier
2024-02-01 3:49 ` Richard Stallman
2024-01-29 17:09 ` Yuri Khan
2024-02-01 3:49 ` Richard Stallman
2024-01-30 3:58 ` Richard Stallman
2024-01-27 11:00 ` Alan Mackenzie
2024-01-27 14:25 ` Stefan Monnier
2024-01-27 23:01 ` Alan Mackenzie [this message]
2024-01-28 0:00 ` Stefan Monnier
2024-01-28 6:12 ` Eli Zaretskii
2024-01-28 17:26 ` Alan Mackenzie
2024-01-28 17:48 ` Eli Zaretskii
2024-01-28 19:42 ` Alan Mackenzie
2024-01-28 20:08 ` Eli Zaretskii
2024-01-28 18:21 ` Stefan Monnier
2024-01-28 18:38 ` Stefan Monnier
2024-01-27 13:14 ` Po Lu
2024-01-27 14:41 ` Stefan Monnier
2024-01-28 1:56 ` Po Lu
2024-01-28 20:55 ` Stefan Kangas
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=ZbWLZWfLAnBGdIMN@ACM \
--to=acm@muc.de \
--cc=emacs-devel@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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).