Thanks,
Daniel
--
If a man is pictured chopping off a woman's breast, it only gets a R rating,
but if, God forbid, a man is pictured kissing a woman's breast, it gets an X
rating. Why is violence more acceptable than tenderness?
-- Sally Struthers
This is explained in clause 7.6 Generic Functions and Methods in the
standard, specifically in 7.6.4 Congruent Lambda-lists for all Methods of
a Generic Function.
///
--
In a fight against something, the fight has value, victory has none.
In a fight for something, the fight is a loss, victory merely relief.
> From my reading of the HyperSpec it seems that you cannot specialize a
> method based on keyword arguments. Can someone confirm that this is,
> indeed, a correct reading of the `defmethod' entry?
Exactly the required parameters are specializable.
See CLHS 7.6.2 Introduction to Methods or the 'defmethod entry'.
--
"Das Auto hat keine Zukunft. Ich setze aufs Pferd." Wilhelm II. (1859-1941)
You can't specialize on keyword arguments, as others have said. If
you want to do that, a common idiom is to split your function into a
function that takes keyword arguments and a generic function called
with sensible defaults by the first function. For example, from McCLIM:
(defun read-gesture (&key
(stream *standard-input*)
timeout
peek-p
(input-wait-test *input-wait-test*)
(input-wait-handler *input-wait-handler*)
(pointer-button-press-handler
*pointer-button-press-handler*))
(stream-read-gesture stream
:timeout timeout
:peek-p peek-p
:input-wait-test input-wait-test
:input-wait-handler input-wait-handler
:pointer-button-press-handler
pointer-button-press-handler))
(defgeneric stream-read-gesture (stream
&key timeout peek-p
input-wait-test
input-wait-handler
pointer-button-press-handler))
Tim