[cdr-discuss] AEQUALIS and COMPARE
Marco Antoniotti
marcoxa at cs.nyu.edu
Sat Feb 26 11:55:05 UTC 2011
Fair enough. I don't have a problem making recursive-p a key. I'll set up another vote.
Cheers
Marco
On Feb 26, 2011, at 09:53 , Christophe Rhodes wrote:
> 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
>
--
Marco Antoniotti
More information about the cdr-discuss
mailing list