help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I do a `cl-undefmethod'?


From: Eduardo Ochs
Subject: How do I do a `cl-undefmethod'?
Date: Sun, 2 Mar 2025 21:44:30 -0300

Hi all,

look at this example:

  (cl-defstruct myab a b)

  (make-myab :a 22 :b 33)
  ;; -> #s(myab 22 33)

  (cl-prin1-to-string (make-myab :a 22 :b 33))
  ;; -> "#s(myab :a 22 :b 33)"

  (cl-defmethod cl-print-object ((object myab) stream)
    (princ (format "%S_%S" (myab-a object) (myab-b object))
           stream))

  (cl-prin1-to-string (make-myab :a 22 :b 33))
  ;; -> "22_33"

Is there an easy way to _undefine_ the `cl-defmethod' above, like a
`makunbound' for an implementation of a generic function? I've tried
to read this

  (info "(elisp)Generic Functions")

and to do some macroexpands, but I couldn't find it...

  Thanks in advance!
    Eduardo Ochs
    http://anggtwu.net/#eev
    http://anggtwu.net/emacsconf2024.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]