[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

predicate function in method group specifiers



    Date: Wed, 29 Aug 90 10:50:01 EDT
    From: kab@charon.MIT.EDU (Kim A. Barrett)

    In the description of method group specifiers for
    DEFINE-METHOD-COMBINATION, a symbol can appear as a predicate function
    instead of a qualifier pattern.  However, it isn't clear whether the symbol
    refers to the global function or if it can refer to a local function in
    whose scope the DEFINE-METHOD-COMBINATION form appears.  That is, in the
    following example, will the call to foo-method-p generated to determine
    whether a method is matched call the global or the local definition.

      (defun foo-method-p ...)

      (flet ((foo-method-p ...))
	(define-method-combination foo ()
	    ((methods foo-method-p))
	  ...))

    Either choice can be easily implemented.  Global would make this similar to
    a SATISFIES type specifier, but I don't think these two situations are
    really analogous.  Somewhat related to this is the question of whether the
    predicate name permitted to name a macro (either global or local).  If
    global definitions are used then the answer probably must be no.  If local
    definitions are used when present, then it is certainly possible.

    The consistent answer is to use the lexical function when present, and that
    macro names are permitted, and may be what was actually intended.

That's what Symbolics CLOS does.  The predicate symbol is simply put into the
car of a form.