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

scope of call-next-method



This message concerns the scope of call-next-method and next-method-p.
Recent drafts of the spec say that the scope of these functions include
the default value forms for optional and keyword arguments.  I believe
that the scope of these should include only the body of the method.

I don't see how what the spec currently says can work.  The problem is
that call-next-method is defined to have access to the bindings of the
arguments to the method.  But if call-next-method is called during the
process of doing those bindings what arguments will it have access to?
What arguments will it pass to the next method?  I believe the only
model that can work reasonably is that call next method is defined only
within the body of the method.

So, my model (and proposal) is that:

(defmethod foo ((x boat))
  (body x))

expands to
  .
  .
  (lambda (x)
    (flet ((call-next-method (&rest args) ...)
           (next-method-p () ...))
      (body x)))

I realize that we could make the rules different for call-next-method
and next-method-p, but I think that would be gratuitous complexity and
incompatibility.
-------