From josip.gracin at gmail.com Mon Oct 22 11:24:33 2007 From: josip.gracin at gmail.com (Josip Gracin) Date: Mon, 22 Oct 2007 13:24:33 +0200 Subject: [cl-containers-devel] Problems with priority queues In-Reply-To: <0A186E42-94EF-452D-9ED7-C3698B4DCA40@metabang.com> References: <463105B8.5000806@tel.fer.hr> <3CFB2150-4BD2-470B-853C-F67C3C7EFF68@metabang.com> <4631813E.30001@tel.fer.hr> <46920186.4070802@tel.fer.hr> <0A186E42-94EF-452D-9ED7-C3698B4DCA40@metabang.com> Message-ID: <471C8871.4070104@gmail.com> Sorry if two copies of the following mail make it to the list. The first was sent from address which is not my subscription address. ========================================================================= 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. From gracin at tel.fer.hr Mon Oct 22 11:02:28 2007 From: gracin at tel.fer.hr (Josip Gracin) Date: Mon, 22 Oct 2007 13:02:28 +0200 Subject: [cl-containers-devel] Problems with priority queues In-Reply-To: <0A186E42-94EF-452D-9ED7-C3698B4DCA40@metabang.com> References: <463105B8.5000806@tel.fer.hr> <3CFB2150-4BD2-470B-853C-F67C3C7EFF68@metabang.com> <4631813E.30001@tel.fer.hr> <46920186.4070802@tel.fer.hr> <0A186E42-94EF-452D-9ED7-C3698B4DCA40@metabang.com> Message-ID: <471C8344.4010403@tel.fer.hr> 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. From gwking at metabang.com Wed Oct 24 13:46:07 2007 From: gwking at metabang.com (Gary King) Date: Wed, 24 Oct 2007 09:46:07 -0400 Subject: [cl-containers-devel] Problems with priority queues In-Reply-To: <471C8344.4010403@tel.fer.hr> References: <463105B8.5000806@tel.fer.hr> <3CFB2150-4BD2-470B-853C-F67C3C7EFF68@metabang.com> <4631813E.30001@tel.fer.hr> <46920186.4070802@tel.fer.hr> <0A186E42-94EF-452D-9ED7-C3698B4DCA40@metabang.com> <471C8344.4010403@tel.fer.hr> Message-ID: 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 From gwking at metabang.com Fri Oct 26 13:25:11 2007 From: gwking at metabang.com (Gary King) Date: Fri, 26 Oct 2007 09:25:11 -0400 Subject: [cl-containers-devel] Problems with priority queues In-Reply-To: References: <463105B8.5000806@tel.fer.hr> <3CFB2150-4BD2-470B-853C-F67C3C7EFF68@metabang.com> <4631813E.30001@tel.fer.hr> <46920186.4070802@tel.fer.hr> <0A186E42-94EF-452D-9ED7-C3698B4DCA40@metabang.com> <471C8344.4010403@tel.fer.hr> Message-ID: <7C1AC41C-829A-4FCA-B125-BE4C9E6AF38F@metabang.com> 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