Breaking changes to eieio in Emacs 27?How to pass an argument to an object constructor that's NOT a slot?
Why are ambiguous grammars bad?
What would be the way to say "just saying" in German? (Not the literal translation)
Can the removal of a duty-free sales trolley result in a measurable reduction in emissions?
Can there be absolute velocity?
Canada travel to US using Global Entry
Multiband vertical antenna not working as expected
Generate certain list from two lists
Was Self-modifying-code possible just using BASIC?
Confused with atmospheric pressure equals plastic balloon’s inner pressure
Make Gimbap cutter
Wizard clothing for warm weather
How to befriend someone who doesn't like to talk?
What should I discuss with my DM prior to my first game?
A Salute to Poetry
Diatonic chords of a pentatonic vs blues scale?
Use 1 9 6 2 in this order to make 75
How was the airlock installed on the Space Shuttle mid deck?
Can you make an identity from this product?
Tikz-cd diagram arrow passing under a node - not crossing it
How to get depth and other lengths of a font?
Why did the World Bank set the global poverty line at $1.90?
The origin of the Russian proverb about two hares
Why is the length of the Kelvin unit of temperature equal to that of the Celsius unit?
Is there a DSLR/mirorless camera with minimal options like a classic, simple SLR?
Breaking changes to eieio in Emacs 27?
How to pass an argument to an object constructor that's NOT a slot?
Q: are there breaking changes to eieio
in Emacs 27?
I just upgraded to the Emacs 27 snapshot, and I'm getting a
peculiar break in code that works in previous versions of Emacs.
walkthrough
Here's a toy class and a toy :after
method:
(defclass simple-class ()
((value
:initarg :value
:initform nil
:documentation "Test slot"))
"Test class.")
This works:
(simple-class :value "some value") ;; ==> #s(simple-class "some value")
Now I'd like to define an :after
method on initialize-instance
:
(cl-defmethod initialize-instance :after ((sc simple-class) &key)
(with-slots (value) sc
(setf value (upcase value))))
Now it's broken:
(simple-class :value "some value") ;; ==> (error "Keyword argument nil not one of nil")
NB: it's nothing about the content of the :after
method: I can
define an empty method and I get the same error.
(cl-defmethod initialize-instance :after ((sc simple-class) &key))
what happened?
So: have there been changes to eieio
(specifically,cl-defmethod
) in Emacs 27 that break previous code? Or is there
something bizarre about the snapshot?
eieio emacs27
add a comment |
Q: are there breaking changes to eieio
in Emacs 27?
I just upgraded to the Emacs 27 snapshot, and I'm getting a
peculiar break in code that works in previous versions of Emacs.
walkthrough
Here's a toy class and a toy :after
method:
(defclass simple-class ()
((value
:initarg :value
:initform nil
:documentation "Test slot"))
"Test class.")
This works:
(simple-class :value "some value") ;; ==> #s(simple-class "some value")
Now I'd like to define an :after
method on initialize-instance
:
(cl-defmethod initialize-instance :after ((sc simple-class) &key)
(with-slots (value) sc
(setf value (upcase value))))
Now it's broken:
(simple-class :value "some value") ;; ==> (error "Keyword argument nil not one of nil")
NB: it's nothing about the content of the :after
method: I can
define an empty method and I get the same error.
(cl-defmethod initialize-instance :after ((sc simple-class) &key))
what happened?
So: have there been changes to eieio
(specifically,cl-defmethod
) in Emacs 27 that break previous code? Or is there
something bizarre about the snapshot?
eieio emacs27
Might be incorrect use of&key
with no following arg name, I think Emacs got stricter about that. By the way, in 25.3, I getLisp error: (wrong-type-argument char-or-string-p nil)
after thecl-defmethod
, did you mean(simple-class :value "some value")
?
– npostavs
8 hours ago
Fixed the typos; sorry. Not sure how else one would define an after method without &keys here.
– Dan♦
8 hours ago
what do you think&key
means in an expression like(cl-defun foo (x &key) nil)
?
– npostavs
8 hours ago
We need the&key
to maintain the same number of arguments. Removing&key
throws an error to that effect.
– Dan♦
8 hours ago
1
C-h n
(view-emacs-news
) is usually the starting point for "What's new?".
– Drew
1 hour ago
add a comment |
Q: are there breaking changes to eieio
in Emacs 27?
I just upgraded to the Emacs 27 snapshot, and I'm getting a
peculiar break in code that works in previous versions of Emacs.
walkthrough
Here's a toy class and a toy :after
method:
(defclass simple-class ()
((value
:initarg :value
:initform nil
:documentation "Test slot"))
"Test class.")
This works:
(simple-class :value "some value") ;; ==> #s(simple-class "some value")
Now I'd like to define an :after
method on initialize-instance
:
(cl-defmethod initialize-instance :after ((sc simple-class) &key)
(with-slots (value) sc
(setf value (upcase value))))
Now it's broken:
(simple-class :value "some value") ;; ==> (error "Keyword argument nil not one of nil")
NB: it's nothing about the content of the :after
method: I can
define an empty method and I get the same error.
(cl-defmethod initialize-instance :after ((sc simple-class) &key))
what happened?
So: have there been changes to eieio
(specifically,cl-defmethod
) in Emacs 27 that break previous code? Or is there
something bizarre about the snapshot?
eieio emacs27
Q: are there breaking changes to eieio
in Emacs 27?
I just upgraded to the Emacs 27 snapshot, and I'm getting a
peculiar break in code that works in previous versions of Emacs.
walkthrough
Here's a toy class and a toy :after
method:
(defclass simple-class ()
((value
:initarg :value
:initform nil
:documentation "Test slot"))
"Test class.")
This works:
(simple-class :value "some value") ;; ==> #s(simple-class "some value")
Now I'd like to define an :after
method on initialize-instance
:
(cl-defmethod initialize-instance :after ((sc simple-class) &key)
(with-slots (value) sc
(setf value (upcase value))))
Now it's broken:
(simple-class :value "some value") ;; ==> (error "Keyword argument nil not one of nil")
NB: it's nothing about the content of the :after
method: I can
define an empty method and I get the same error.
(cl-defmethod initialize-instance :after ((sc simple-class) &key))
what happened?
So: have there been changes to eieio
(specifically,cl-defmethod
) in Emacs 27 that break previous code? Or is there
something bizarre about the snapshot?
eieio emacs27
eieio emacs27
edited 1 hour ago
Drew
49.5k465111
49.5k465111
asked 9 hours ago
Dan♦Dan
21.6k653114
21.6k653114
Might be incorrect use of&key
with no following arg name, I think Emacs got stricter about that. By the way, in 25.3, I getLisp error: (wrong-type-argument char-or-string-p nil)
after thecl-defmethod
, did you mean(simple-class :value "some value")
?
– npostavs
8 hours ago
Fixed the typos; sorry. Not sure how else one would define an after method without &keys here.
– Dan♦
8 hours ago
what do you think&key
means in an expression like(cl-defun foo (x &key) nil)
?
– npostavs
8 hours ago
We need the&key
to maintain the same number of arguments. Removing&key
throws an error to that effect.
– Dan♦
8 hours ago
1
C-h n
(view-emacs-news
) is usually the starting point for "What's new?".
– Drew
1 hour ago
add a comment |
Might be incorrect use of&key
with no following arg name, I think Emacs got stricter about that. By the way, in 25.3, I getLisp error: (wrong-type-argument char-or-string-p nil)
after thecl-defmethod
, did you mean(simple-class :value "some value")
?
– npostavs
8 hours ago
Fixed the typos; sorry. Not sure how else one would define an after method without &keys here.
– Dan♦
8 hours ago
what do you think&key
means in an expression like(cl-defun foo (x &key) nil)
?
– npostavs
8 hours ago
We need the&key
to maintain the same number of arguments. Removing&key
throws an error to that effect.
– Dan♦
8 hours ago
1
C-h n
(view-emacs-news
) is usually the starting point for "What's new?".
– Drew
1 hour ago
Might be incorrect use of
&key
with no following arg name, I think Emacs got stricter about that. By the way, in 25.3, I get Lisp error: (wrong-type-argument char-or-string-p nil)
after the cl-defmethod
, did you mean (simple-class :value "some value")
?– npostavs
8 hours ago
Might be incorrect use of
&key
with no following arg name, I think Emacs got stricter about that. By the way, in 25.3, I get Lisp error: (wrong-type-argument char-or-string-p nil)
after the cl-defmethod
, did you mean (simple-class :value "some value")
?– npostavs
8 hours ago
Fixed the typos; sorry. Not sure how else one would define an after method without &keys here.
– Dan♦
8 hours ago
Fixed the typos; sorry. Not sure how else one would define an after method without &keys here.
– Dan♦
8 hours ago
what do you think
&key
means in an expression like (cl-defun foo (x &key) nil)
?– npostavs
8 hours ago
what do you think
&key
means in an expression like (cl-defun foo (x &key) nil)
?– npostavs
8 hours ago
We need the
&key
to maintain the same number of arguments. Removing &key
throws an error to that effect.– Dan♦
8 hours ago
We need the
&key
to maintain the same number of arguments. Removing &key
throws an error to that effect.– Dan♦
8 hours ago
1
1
C-h n
(view-emacs-news
) is usually the starting point for "What's new?".– Drew
1 hour ago
C-h n
(view-emacs-news
) is usually the starting point for "What's new?".– Drew
1 hour ago
add a comment |
1 Answer
1
active
oldest
votes
So: have there been changes to
eieio
(specifically,cl-defmethod
) in Emacs 27 that break previous code?
It's not a change in eieio
or cl-defmethod
directly; what's changed is the handling of the &key
symbol in cl-def*
macros.
(cl-defmethod initialize-instance :after ((sc simple-class) &key))
In Emacs 26 and earlier this produces a function which accepts any number of arguments. In Emacs 27 it produces a function which accepts only one argument (sc
). The correct argument list for initialize-instance
would be like this:
(cl-defmethod initialize-instance :after ((sc simple-class) &optional slots))
As told by <f1> f initialize-instance RET
:
initialize-instance is a compiled Lisp function in ‘eieio.el’.
(initialize-instance THIS &optional SLOTS)
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "583"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f50922%2fbreaking-changes-to-eieio-in-emacs-27%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
So: have there been changes to
eieio
(specifically,cl-defmethod
) in Emacs 27 that break previous code?
It's not a change in eieio
or cl-defmethod
directly; what's changed is the handling of the &key
symbol in cl-def*
macros.
(cl-defmethod initialize-instance :after ((sc simple-class) &key))
In Emacs 26 and earlier this produces a function which accepts any number of arguments. In Emacs 27 it produces a function which accepts only one argument (sc
). The correct argument list for initialize-instance
would be like this:
(cl-defmethod initialize-instance :after ((sc simple-class) &optional slots))
As told by <f1> f initialize-instance RET
:
initialize-instance is a compiled Lisp function in ‘eieio.el’.
(initialize-instance THIS &optional SLOTS)
add a comment |
So: have there been changes to
eieio
(specifically,cl-defmethod
) in Emacs 27 that break previous code?
It's not a change in eieio
or cl-defmethod
directly; what's changed is the handling of the &key
symbol in cl-def*
macros.
(cl-defmethod initialize-instance :after ((sc simple-class) &key))
In Emacs 26 and earlier this produces a function which accepts any number of arguments. In Emacs 27 it produces a function which accepts only one argument (sc
). The correct argument list for initialize-instance
would be like this:
(cl-defmethod initialize-instance :after ((sc simple-class) &optional slots))
As told by <f1> f initialize-instance RET
:
initialize-instance is a compiled Lisp function in ‘eieio.el’.
(initialize-instance THIS &optional SLOTS)
add a comment |
So: have there been changes to
eieio
(specifically,cl-defmethod
) in Emacs 27 that break previous code?
It's not a change in eieio
or cl-defmethod
directly; what's changed is the handling of the &key
symbol in cl-def*
macros.
(cl-defmethod initialize-instance :after ((sc simple-class) &key))
In Emacs 26 and earlier this produces a function which accepts any number of arguments. In Emacs 27 it produces a function which accepts only one argument (sc
). The correct argument list for initialize-instance
would be like this:
(cl-defmethod initialize-instance :after ((sc simple-class) &optional slots))
As told by <f1> f initialize-instance RET
:
initialize-instance is a compiled Lisp function in ‘eieio.el’.
(initialize-instance THIS &optional SLOTS)
So: have there been changes to
eieio
(specifically,cl-defmethod
) in Emacs 27 that break previous code?
It's not a change in eieio
or cl-defmethod
directly; what's changed is the handling of the &key
symbol in cl-def*
macros.
(cl-defmethod initialize-instance :after ((sc simple-class) &key))
In Emacs 26 and earlier this produces a function which accepts any number of arguments. In Emacs 27 it produces a function which accepts only one argument (sc
). The correct argument list for initialize-instance
would be like this:
(cl-defmethod initialize-instance :after ((sc simple-class) &optional slots))
As told by <f1> f initialize-instance RET
:
initialize-instance is a compiled Lisp function in ‘eieio.el’.
(initialize-instance THIS &optional SLOTS)
answered 7 hours ago
npostavsnpostavs
7,05611237
7,05611237
add a comment |
add a comment |
Thanks for contributing an answer to Emacs Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f50922%2fbreaking-changes-to-eieio-in-emacs-27%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Might be incorrect use of
&key
with no following arg name, I think Emacs got stricter about that. By the way, in 25.3, I getLisp error: (wrong-type-argument char-or-string-p nil)
after thecl-defmethod
, did you mean(simple-class :value "some value")
?– npostavs
8 hours ago
Fixed the typos; sorry. Not sure how else one would define an after method without &keys here.
– Dan♦
8 hours ago
what do you think
&key
means in an expression like(cl-defun foo (x &key) nil)
?– npostavs
8 hours ago
We need the
&key
to maintain the same number of arguments. Removing&key
throws an error to that effect.– Dan♦
8 hours ago
1
C-h n
(view-emacs-news
) is usually the starting point for "What's new?".– Drew
1 hour ago