[cl-containers-devel] Problems with priority queues

Gary King gwking at metabang.com
Fri Oct 26 13:25:11 UTC 2007


Hi Josip,

CL-Containers 0.9.10 includes a different fix for the problem you  
found. I rewrote delete-first to use first-node and find-node instead  
of first-element and find-element. (Though I had to write first-node  
to do so!). This seems cleaner and clearer to me and, I suppose, will  
even be slightly faster in most cases.

Thanks again, any suggestions or improvements or bug reports (!) you  
(or anyone else!) has are always welcome,

On Oct 24, 2007, at 9:46 AM, Gary King wrote:

> Hi Josip,
>
> Dang. You have got to stop finding these bugs. I'll get all  
> depressed and embarrassed.
>
> Seriously, thanks for the bug find, the test case and the pointer  
> to the fix. I'll keep these out very soon.
>
> Thanks for your perseverance,
>
>
>
> On Oct 22, 2007, at 7:02 AM, Josip Gracin wrote:
>
>> Hi Gary!
>>
>> It's me and my queues again. :-)  Here's a test that fails on  
>> Containers version 0.9.8, i.e. the latest from asdf-install.  I've  
>> created a separate test file for priority queues so that you can  
>> easily add it to the test suite, if you like.
>>
>> ------------------------------------------------------------
>> tests/test-prio-queue.lisp
>> ------------------------------------------------------------
>>
>> (in-package #:cl-containers-test)
>>
>> (deftestsuite test-prio-queue ()
>>   ((q (make-instance 'priority-queue-on-container
>>                      :sorter #'string<
>>                      :test #'string=))))
>>
>> (deftestsuite test-delete-prio-queue (test-prio-queue)
>>   ()
>>   (:setup (insert-item q "a")
>>           (insert-item q "b")
>>           (insert-item q "c")))
>>
>> (addtest (test-delete-prio-queue)
>>   delete-first-1
>>   (delete-first q)
>>   (ensure-same (first-element q) "b")
>>   (delete-first q)
>>   (ensure-same (first-element q) "c"))
>>
>> --------------------------------------------------------------
>>
>>
>> Not calling ELEMENT in queues.lisp:76 solves the problem.
>>
>> _______________________________________________
>> 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
>
>
>
>
> _______________________________________________
> 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