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

Re: no-next-method | no-applicable-method

This message is an attempt to summarize the discussion on this issue.  I
present what I believe we have decided so that it can be written up and
put into the specification.

As Moon says:

    Date: Wed, 4 May 88 13:51 EDT
    From: David A. Moon <Moon@STONY-BROOK.SCRC.Symbolics.COM>

    I think we are all agreed that CALL-NEXT-METHOD, when there is no next
    method, should call a user specializable generic function, rather than
    directly signalling an error as 88-002 says.  The only point of contention
    is what should the name of that generic function be.

As for people's opinion on the secondary question of what the name and
arguments of the user specializable generic function should be, most
people seem to have swung over now to the position that call-next-method
errors should have their own generic function with its own argument
list.  In recent messages,

    Moon says:
    I have no strong opinion on this issue.  My own sense of programming
    style dictates that in any program I wrote, two separate generic
    functions would be used.

    RPG says:

    In any event, I found the combination of Danny's and Jonl's arguments
    persuasive. That is, CALL-NEXT-METHOD errors could be so obscure
    that it deserves its own generic function.

So I believe we should have a generic function no-next-method.  It
receives as arguments:

  - the generic function belonging to the method (which is the
    second argument)

  - the method which Moon described by saying:

     I think what you mean is more precisely stated as: the method that
     created the local definition of call-next-method that had no next
     method.  Because closures of call-next-method can be passed around
     as funargs, this may not be the currently executing method at the
     time NO-NEXT-METHOD is called.

  - and the arguments to call-next-method. These are passed with apply.

There is a system supplied method defined as if:

(defmethod no-next-method ((gf standard-generic-function)
                           (me standard-method)
                           &rest args)
  (error "No next method when CALL-NEXT-METHOD is called."))

Unless there are further objections to this, I believe it can go into
chapter 1 and 2.