Methods and functions do not apply to packages. Symbols belong to packages.
(defpackage :common (:use :cl)) (in-package :common) (defgeneric compare (ab)) (defmethod compare ((a number) (b number)) (cond ((< ab) -1) ((= ab) 0) (T 1))) (defpackage :a (:use :cl)) (in-package :a) (defclass foo (ab))
If A is the current package, then you need to write common :: compare to access the unexported COMPARE symbol of the COMMON package.
(defmethod common::compare ((x foo) (y foo)) ...)
If COMPARE is exported from the COMMON package, you can write:
(defmethod common:compare ((x foo) (y foo)) ...)
If COMPARE is exported from the COMMON package, and package A will use the COMMON package, you can write:
(defmethod compare ((x foo) (y foo)) ...)
source share