GNU bug report logs -
#29165
26.0.90; can't use some code byte-compiled under emacs 24
Previous Next
Reported by: Ken Raeburn <raeburn <at> permabit.com>
Date: Mon, 6 Nov 2017 06:58:02 UTC
Severity: normal
Tags: fixed, patch
Found in versions 26.1, 26.0.90
Fixed in version 27.1
Done: Noam Postavsky <npostavs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
tags 29165 + notabug
quit
Ken Raeburn <raeburn <at> permabit.com> writes:
> (defun* foobar (init-fun test-fun cleanup-fun
> &optional &key
> Use Emacs 24.3 to byte-compile the file.
>
> Start the Emacs 26 pretest, and load the .elc file.
> Debugger entered--Lisp error: (invalid-function #f(compiled-function (init-fun test-fun cleanup-fun &optional &rest --cl-rest--) "Blah blah blah"
> It appears that the eval.c code of 26.0.90 doesn't like to see &optional
> and &rest together in the argument list of a compiled function.
Yes, see Bug#24912 and Bug#24913.
> But in this case, the byte compiler from version 24 does generate
> that. In version 25, only &rest is put into the list.
It's not the byte compiler specifically, the defun* macro (aka cl-defun)
expands &key into &rest, so the expansion has &optional &rest. At any
rate, using &optional is meaningless there, so the solution is just to
remove it.
We should perhaps put something about throwing error on '&option &rest'
into NEWS though.
This bug report was last modified 7 years and 137 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.