《通链参考手册》


Standard Generic Function FUNCTION-KEYWORDS

●语法设定:

function-keywords method => keys, allow-other-keys-p

Method Signatures:

function-keywords (method standard-method)

●参数和值:

method---a method.

keys---a list.

allow-other-keys-p---a generalized boolean.

●详情:

Returns the keyword parameter specifiers for a method.

Two values are returned: a list of the explicitly named keywords and a generalized boolean that states whether &allow-other-keys had been specified in the method definition.

●例子:

 (defmethod gf1 ((a integer) &optional (b 2)
                 &key (c 3) ((:dee d) 4) e ((eff f)))
   (list a b c d e f))
=>  #<STANDARD-METHOD GF1 (INTEGER) 36324653>
 (find-method #'gf1 '() (list (find-class 'integer))) 
=>  #<STANDARD-METHOD GF1 (INTEGER) 36324653>
 (function-keywords *)
=>  (:C :DEE :E EFF), false
 (defmethod gf2 ((a integer))
   (list a b c d e f))
=>  #<STANDARD-METHOD GF2 (INTEGER) 42701775>
 (function-keywords (find-method #'gf1 '() (list (find-class 'integer))))
=>  (), false
 (defmethod gf3 ((a integer) &key b c d &allow-other-keys)
   (list a b c d e f))
 (function-keywords *)
=>  (:B :C :D), true

●受制于:

defmethod

●例外情况: 无。

●更多信息:

defmethod

●说明: 无。


◇首页 § ◎章节目录 § □内容索引 § ○符号索引 § △术语表 § ※设计草案