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

lambda-list in defgeneric, generic-flet, etc.

Never mind the one-word answer.

It's clear that the lambda-list is needed sometimes.  It's needed for
&key, it's needed for :argument-precedence-order, and it's needed when
no methods are specified.  It's also needed if the lambda-list serves
as documentation and the most appropriate and explanatory parameter names
are different for the generic function than for the method.

The question is whether to allow the lambda-list to be omitted in some

You seem to be concerned about the redundancy when there is exactly one
method specified.  Obviously if there are no methods there is no redundant
lambda-list, and if there is more than one method specified in the
defgeneric or generic-flet or what have you, there is redundancy anyway.
My feeling is that making the syntax more cumbersome and less consistent,
by making the lambda-list optional, in order to eliminate this tiny bit of
redundancy, is not worthwhile.  Also I think the redundancy can be justified
as a valuable sanity check.

Another interesting piece of experience is that the syntax of :method in
defgeneric in Flavors tries to avoid such redundancy.  It has a lambda-list
for the defgeneric, but no lambda-list for the methods, just a parameter
specializer name (to use CLOS terminology).  I think that experience with
this has shown that it was a bad idea and that it would have been better to
have the redundancy for the sake of a more consistent syntax.