Prompters have a bunch of slots which are meant to be functions.
prompt class:
constructor
before-destructor
after-destructor
source class:
constructor
destructor
suggestion-maker
filter
filter-preprocessor
filter-postprocessor
resumer
There are also actions and selection-actions but, since it's a list of functions, methods would not do here.
Generic functions have many benefits over standard functions, but I can think of one drawback: Typically they are defined globally and methods must be specialized on classes, not objects.
We often have a use case like this:
(prompt
:prompt "Reduce buffer(s)"
:sources (make-instance 'buffer-source
:constructor (remove-if #'internal-url-p (buffer-list)
:key #'url)
:return-actions '(identity)
:multi-selection-p t))
Here it's convenient that we do not have to define a source only for the purpose of specializing the constructor.
Suggestion: go with generic functions but keep the constructor and *-destructor slots for local overrides.
Thoughts?
Prompters have a bunch of slots which are meant to be functions.
promptclass:constructorbefore-destructorafter-destructorsourceclass:constructordestructorsuggestion-makerfilterfilter-preprocessorfilter-postprocessorresumerThere are also
actionsandselection-actionsbut, since it's a list of functions, methods would not do here.Generic functions have many benefits over standard functions, but I can think of one drawback: Typically they are defined globally and methods must be specialized on classes, not objects.
We often have a use case like this:
Here it's convenient that we do not have to define a source only for the purpose of specializing the constructor.
Suggestion: go with generic functions but keep the
constructorand*-destructorslots for local overrides.Thoughts?