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

CLOS lambda-list congruence



I have a question for the CLOS gurus; I hope this is the appropriate
mailing list.

In testing a program we are writing for automatically translating source
code from Flavors to CLOS, I found that by far the biggest problem with
the automatically translated code is non-congruence of method
parameters.  When writing flavors, I often had a method with parameters
like
  (a b &optional x y)
but would then write a :BEFORE or :AFTER method with parameters like
  (a b &rest ignore)
which worked fine with flavors, but CLOS considers these lambda lists to
not be equivalent.  Can someone explain why this particular restriction
is necessary?

Although the above example is merely a nuisance, a more troubling case
is a method which translates to: 

(DEFMETHOD PRINT-DESCRIPTION ((SELF TRANSPORTER) &REST ARGS)
  (WITH-SLOTS (POSITION) SELF
    (APPLY #'PRINT-DESCRIPTION POSITION ARGS))) 

Here I don't want to enumerate the optional arguments because I want to
let the function (or in this case, method) being called do the
defaulting.  I don't see why the implementation couldn't permit this.