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?













2















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?










share|improve this question
























  • 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











  • 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















2















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?










share|improve this question
























  • 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











  • 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













2












2








2








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?










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 1 hour ago









Drew

49.5k465111




49.5k465111










asked 9 hours ago









DanDan

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 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











  • 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











  • 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










1 Answer
1






active

oldest

votes


















2















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)






share|improve this answer























    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
    );



    );













    draft saved

    draft discarded


















    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









    2















    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)






    share|improve this answer



























      2















      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)






      share|improve this answer

























        2












        2








        2








        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)






        share|improve this answer














        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)







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 7 hours ago









        npostavsnpostavs

        7,05611237




        7,05611237



























            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

            Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

            Ласкавець круглолистий Зміст Опис | Поширення | Галерея | Примітки | Посилання | Навігаційне меню58171138361-22960890446Bupleurum rotundifoliumEuro+Med PlantbasePlants of the World Online — Kew ScienceGermplasm Resources Information Network (GRIN)Ласкавецькн. VI : Літери Ком — Левиправивши або дописавши її