Skip to content

Advanced argument handling in method and define-method

Some users may find it more natural not to have to choose between define-method and define-method* in their code.

It turns out that method* and define-method* can do just fine also for ordinary methods without keyword formals. They take marginally longer to compile but result in the same code as method and define-method if keyword formals are absent.

For this reason, we provide a module (oop goops keyword-formals) which replaces the standard method and define-method bindings with their keyword formal counterparts. It can be used like this:

emacs-lisp
(use-modules (oop goops) (oop goops keyword-formals))

or

emacs-lisp
(define-module (foo)
  #:use-module (oop goops)
  #:use-module (oop goops keyword-formals))