[cdr-discuss] AEQUALIS and COMPARE

Christophe Rhodes csr21 at cantab.net
Sat Feb 26 08:53:15 UTC 2011


Marco Antoniotti <marcoxa at cs.nyu.edu> writes:

> On Feb 25, 2011, at 19:58 , Matthew Swank wrote:
>> What is the rationale for making recursive-p an optional argument instead of a
>> keyword argument?  It generates style warnings and makes it clumsy to delegate
>> to aequalis/compare in other functions.
>
> Aesthetics?  It is nicer to write
>
> (equals #((foo)) #((bar)) t)
>
> than
>
> (equals #((foo)) #((bar)) :recursive-p t)
>
> What style warnings are generated and by which implementation?  I don't get any.

Mixing &optional and &key arguments in a lambda list is an excellent way
to cause confusion down the line; is it nicer to write

(equals #S(foo :a 1) #S(foo :a 2) :mykey t)

or

(equals #S(foo :a 1) #S(foo :a 2) nil :mykey t)

?  SBCL generates style warnings if you mix &optional and &key in a
lambda list, mostly to warn people with dubious aesthetics that it's a
fairly bad idea.  (See also the FAQ about READ-FROM-STRING).

Best,

Christophe




More information about the cdr-discuss mailing list