One annoyance of ensure-generic-function-using-class

Didier Verna didier at lrde.epita.fr
Wed Dec 27 11:50:48 UTC 2017


  Hello,

there is something annoying with
ensure-generic-function-using-class. The MOP specifies that if the
:generic-function-class option is not provided, it defaults to
standard-generic-function. While this makes perfect sense when the
generic function doesn't already exist, it seems to also apply when it
does.

As a result, if you want to call ensure-generic-function on an existing
generic function using a different meta-class, for instance like this:

(ensure-generic-function gf-name :generic-function-class (class-of gf))


This is a bit annoying, and I don't understand the rationale behind
this, if there's one. Why not defaulting to the existing generic
function's meta-class?

-- 
Resistance is futile. You will be jazzimilated.

Lisp, Jazz, Aïkido: http://www.didierverna.info



More information about the pro mailing list