all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ken Raeburn <raeburn@permabit.com>
To: Noam Postavsky <npostavs@users.sourceforge.net>
Cc: Andreas Schwab <schwab@linux-m68k.org>,
	Philipp Stephani <p.stephani2@gmail.com>,
	29165@debbugs.gnu.org
Subject: bug#29165: 26.0.90; can't use some code byte-compiled under emacs 24
Date: Mon, 13 Nov 2017 14:42:18 -0500	[thread overview]
Message-ID: <3EB0E53F-4B99-44C2-9F2E-1125A33E408B@permabit.com> (raw)
In-Reply-To: <CAM-tV-8jXW0taJbDqVkzFTUioFGfLQFqNFwRaWYon0rnRFgscA@mail.gmail.com>


On Nov 13, 2017, at 13:06, Noam Postavsky <npostavs@users.sourceforge.net> wrote:

> On Mon, Nov 6, 2017 at 2:16 PM, Noam Postavsky
> <npostavs@users.sourceforge.net> wrote:
>> On Mon, Nov 6, 2017 at 2:10 PM, Ken Raeburn <raeburn@permabit.com> wrote:
>> 
>>> It appears that the emacs-26 version of defun* is happy with it (the
>>> original Lisp code I posted, using &optional &key) as well, as long as I
>>> provide the source, or a byte-compiled file from Emacs 25 or 26
>> 
>> It looks like the cl-defun in newer Emacs throws away the &optional
>> for you in this case.
> 
> I think we should make cl-defun reject this kind of code, to be
> consistent with plain defun. See attached.

I’m of two minds about it… it’s a useless but harmless degenerate case, and based on the link Drew posted and the test Andreas did, making it an error would be a gratuitous incompatibility with CL or at least one implementation.  And maybe it’s not entirely useless if it simplifies someone’s macro so that they can treat zero-or-more optional variables with a single, simple common code path.  But even if we do make it an error, isn’t there usually a stage where it’s just a warning?

(And if we’re going to make that sort of thing an error, we should probably check whether empty &key or &aux variable lists are similarly rejected.  I haven’t looked.)

Also, what the CL macros do going forward is arguably a separate question from whether byte-code processing should reject the byte code generated for the same construct by older releases.  That’s what we’ve got now — Emacs 26.0.90 accepts the forms for CL macros but rejects them in byte code, and Emacs 24 CL macros produced such forms in byte code when given such forms as input.  So currently-acceptable code, or at least code still treated as acceptable under Emacs 25, when compiled by an older release, is no longer accepted. If the source isn’t going to be rejected (e.g., if it’s quietly accepted or only produces a warning), then the byte-code for it probably ought not to be rejected.

Ken




  reply	other threads:[~2017-11-13 19:42 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-06  6:57 bug#29165: 26.0.90; can't use some code byte-compiled under emacs 24 Ken Raeburn
2017-11-06 12:44 ` Noam Postavsky
2017-11-06 14:24   ` Drew Adams
2017-11-06 14:35     ` Noam Postavsky
2017-11-06 14:40       ` Drew Adams
2017-11-06 17:20         ` Philipp Stephani
2017-11-06 17:25         ` Ken Raeburn
2017-11-06 18:10           ` Andreas Schwab
2017-11-06 19:10             ` Ken Raeburn
2017-11-06 19:16               ` Noam Postavsky
2017-11-13 18:06                 ` Noam Postavsky
2017-11-13 19:42                   ` Ken Raeburn [this message]
2017-11-13 20:05                     ` Noam Postavsky
2017-11-27 22:24                       ` Noam Postavsky
2017-12-13 22:36                         ` Noam Postavsky
2017-12-15 16:48                           ` Glenn Morris
2017-12-16  4:54                             ` Noam Postavsky
2018-01-20 22:10                               ` Noam Postavsky
2018-01-21  3:02                                 ` Stefan Monnier
2018-01-21 16:04                                 ` Eli Zaretskii
2018-01-21 16:30                                   ` Noam Postavsky
2018-01-21 18:01                                     ` Eli Zaretskii
2018-03-25 15:32                                       ` Noam Postavsky
2017-12-13 23:39                       ` Stefan Monnier
2017-12-15  1:16                         ` Noam Postavsky
2017-12-15  3:04                           ` Stefan Monnier
2017-12-15  5:17                             ` Ken Raeburn
2017-12-15 13:54                               ` Stefan Monnier
2017-11-06 19:31           ` Drew Adams
2017-11-06 16:08   ` Eli Zaretskii

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=3EB0E53F-4B99-44C2-9F2E-1125A33E408B@permabit.com \
    --to=raeburn@permabit.com \
    --cc=29165@debbugs.gnu.org \
    --cc=npostavs@users.sourceforge.net \
    --cc=p.stephani2@gmail.com \
    --cc=schwab@linux-m68k.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.