在lisp中,什么是"样式警告:隐式创建新的通用函数"?

Mar*_*ark 2 warnings sbcl common-lisp

这个警告意味着什么?我有一个我在下面使用的例子,有这个警告.我在某处做错了吗?

(defvar B_00 0)
(defvar B_000 0)
(defvar w_000 0)
(defvar w_00 0)
(defconstant white 0)

(defclass board ()
 ((blocker    :accessor blocker    :initarg :blocker    :initform  0)
  (friends    :accessor friends    :initarg :friends    :initform (make-array '(2)))
  (kings      :accessor kings      :initarg :kings      :initform (make-array '(2)))
  (boards     :accessor boards     :initarg :boards     :initform (make-array '(2 7) :initial-element 0))
  (enpassant  :accessor enpassant  :initarg :enpassant  :initform -1)
  (color      :accessor color      :initarg :color      :initform  WHITE)
  (castling   :accessor castling   :initarg :castling   :initform  (logior B_000 B_00 W_000 W_00))
  (hasCastled :accessor hasCastled :initarg :hasCastled :initform  (make-array '(2) :initial-element nil))
  (fifty      :accessor fifty      :initarg :fifty      :initform 0)
  (checked    :accessor checked    :initarg :checked    :initform nil)
  (opchecked  :accessor opchecked  :initarg :opchecked  :initform nil)
  (arBoard    :accessor arBoard    :initarg :arBoard    :initform (make-array '(64))) 
  (hash       :accessor hash       :initarg :hash       :initform 0)
  (pawnhash   :accessor pawnhash   :initarg :pawnhash   :initform 0)
  (history    :accessor history    :initarg :history    :initform '())))

(defmethod ischecked ((b board)) b)
Run Code Online (Sandbox Code Playgroud)

Ram*_*ren 6

在定义实现它的任何方法之前,您应该使用DEFGENERIC定义泛型函数.没有匹配的泛型函数定义的方法定义将自动创建一个泛型函数(即隐式).但是,如果你自己定义一个通用的功能,即使你不需要针对任何特定的功能defgeneric,如果你在任何方法定义的拼错的域名(虽然界面文档是一个好主意),你会被警告.它还清楚地表明,如果它们被改变并且在方法之间变得不匹配,那么它们应该是什么.