[cl-containers-devel] insert-new-item should apply key to item

Daniel Dickison danieldickison at gmail.com
Sat Jun 21 11:08:45 UTC 2008


Thank you for the quick action. It's great to see that you're actively  
maintaining the library :-)


On Jun 20, 2008, at 9:37, Gary King <gwking at metabang.com> wrote:

> Daniel,
>
> Your patch went out last night. Thanks again.
>
> On Jun 18, 2008, at 9:33 PM, Daniel Dickison wrote:
>
>> I just started using cl-containers and found insert-new-item to be  
>> a bit puzzling when used with a container with a specified :key.   
>> Namely, I think insert-new-item should apply the key function to  
>> the new item in addition to applying it to the items already in the  
>> container.  Otherwise, you get weirdness like:
>>
>> CL-USER> (defparameter foo (make-instance 'cl-containers:sorted- 
>> list-container
>>                                         :test #'equalp
>>                                         :key #'car))
>> FOO
>> CL-USER> (cl-containers:insert-new-item foo '(1 a))
>> CL-USER> (cl-containers:print-container foo)
>> ((1 A))
>> CL-USER> (cl-containers:insert-new-item foo '(1 a))
>> CL-USER> (cl-containers:print-container foo)
>> ((1 A) (1 A))
>>
>> I think it makes sense to apply the key to the new item in all  
>> cases, but there might be some case I'm not thinking of.  Attached  
>> is a patch.
>>
>> Daniel
>>
>> P.S. What's a good file extension for darcs patches?
>>
>> <insert-new-item.changes>
>> _______________________________________________
>> cl-containers-devel mailing list
>> cl-containers-devel at common-lisp.net
>> http://common-lisp.net/cgi-bin/mailman/listinfo/cl-containers-devel
>
> --
> Gary Warren King, metabang.com
> Cell: (413) 559 8738
> Fax: (206) 338-4052
> gwkkwg on Skype * garethsan on AIM
>
>
>
>



More information about the cl-containers-devel mailing list