The Art of the Metaobject Protocol- P11: The work described here is synthetic in nature, bringing together techniques and insights from several branches of computer. | A Working Closette Implementation 303 defun std-compute-discriminating-function gf lambda ftrest args let classes mapcar class-of required-portion gf args emfun gethash classes classes-to-emf-table gf nil if emfun funcall emfun args slow-method-lookup gf args classes defun slow-method-lookup gf args classes let applicable-methods compute-applicable-methods-using-classes gf classes emfun funcall if eq class-of gf the-class-standard-gf std-compute-effective-method-function compute-effective-method-function gf applicable-methods setf gethash classes classes-to-emf-table gf emfun funcall emfun args compute-applicable-methods-using-classes defun compute-applicable-methods-using-classes gf required-classes sort copy-list remove-if-not lambda method every subclassp required-classes method-specializers method generic-function-methods gf lambda ml m2 funcall if eq class-of gf the-class-standard-gf std-method-more-specif ic-p method-more-specif ic-p gf ml m2 required-classes method-more-specific-p defun std-method-more-specific-p gf methodi method2 required-classes declare ignore gf mapc lambda sped spec2 arg-class unless eq sped spec2 return-from std-method-more-specific-p 304 Appendix D sub-specializer-p sped spec2 arg-class method-specializers methodi method-specializers method2 required-classes nil apply-methods and compute-effective-method-function defun apply-methods gf args methods funcall compute-effective-method-function gf methods args defun primary-method-p method null method-qualifiers method defun before-method-p method equal before method-qualifiers method defun after-method-p method equal 1 after method-qualifiers method defun around-method-p method equal around method-qualifiers method defun std-compute-effective-method-function gf methods let primaries remove-if-not primary-method-p methods around find-if around-method-p methods when null primaries error No primary methods for the O generic function S. gf if around let next-emfun funcall if eq class-of gf .