From gracin at tel.fer.hr Thu Apr 26 20:04:08 2007 From: gracin at tel.fer.hr (Josip Gracin) Date: Thu, 26 Apr 2007 22:04:08 +0200 Subject: [cl-containers-devel] Problems with priority queues Message-ID: <463105B8.5000806@tel.fer.hr> Hello! I'm having problems with priority queue in cl-containers (installed by asdf-install, SBCL 1.0.4.109). Here's what I'm trying: ====================================================================== * (defparameter *s* (make-container 'priority-queue-on-container)) *S* * (insert-item *s* 1.0) # # * (first-item *s*) debugger invoked on a SIMPLE-ERROR in thread #: There is no applicable method for the generic function # when called with arguments (1.0). ====================================================================== I've checked the sources of cl-containers and if I delete all calls to function ELEMENT, priority queues begin to work as expected. Am I doing something wrong in the above example? From gwking at metabang.com Fri Apr 27 02:30:35 2007 From: gwking at metabang.com (Gary King) Date: Thu, 26 Apr 2007 22:30:35 -0400 Subject: [cl-containers-devel] Problems with priority queues In-Reply-To: <463105B8.5000806@tel.fer.hr> References: <463105B8.5000806@tel.fer.hr> Message-ID: <3CFB2150-4BD2-470B-853C-F67C3C7EFF68@metabang.com> Hi Josip, Thanks for your clear instructions on how to recreate this bug (and it's definitely a CL-Containers problem, not anything that you're doing wrong). It looks to me as if the first-element methods for priority-queue-on- container are screwed up. Since the first-element call to the container of the priority-queue-on-container will return an element (not a node), it makes no sense to call element again. In short, instead of > (defmethod first-element ((q priority-queue-on-container)) > (element (first-element (container q)))) it should be > (defmethod first-element ((q priority-queue-on-container)) > (first-element (container q))) > > (defmethod (setf first-element) (value (q priority-queue-on- > container)) > (setf (first-element (container q)) value)) I should be able to get this out sometime tomorrow. thanks again, -- Gary Warren King, metabang.com Cell: (413) 885 9127 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM From gracin at tel.fer.hr Fri Apr 27 04:51:10 2007 From: gracin at tel.fer.hr (Josip Gracin) Date: Fri, 27 Apr 2007 06:51:10 +0200 Subject: [cl-containers-devel] Problems with priority queues In-Reply-To: <3CFB2150-4BD2-470B-853C-F67C3C7EFF68@metabang.com> References: <463105B8.5000806@tel.fer.hr> <3CFB2150-4BD2-470B-853C-F67C3C7EFF68@metabang.com> Message-ID: <4631813E.30001@tel.fer.hr> Gary King wrote: > I should be able to get this out sometime tomorrow. Great! Thanks for great work! From gwking at metabang.com Sun Apr 29 22:13:21 2007 From: gwking at metabang.com (Gary King) Date: Sun, 29 Apr 2007 18:13:21 -0400 Subject: [cl-containers-devel] Problems with priority queues In-Reply-To: <4631813E.30001@tel.fer.hr> References: <463105B8.5000806@tel.fer.hr> <3CFB2150-4BD2-470B-853C-F67C3C7EFF68@metabang.com> <4631813E.30001@tel.fer.hr> Message-ID: Hi Josip, This should now be corrected; you may need to update metatilities too. Please let me know, On Apr 27, 2007, at 12:51 AM, Josip Gracin wrote: > Gary King wrote: >> I should be able to get this out sometime tomorrow. > > Great! Thanks for great work! -- Gary Warren King, metabang.com Cell: (413) 885 9127 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM From gracin at tel.fer.hr Mon Apr 30 08:35:14 2007 From: gracin at tel.fer.hr (Josip Gracin) Date: Mon, 30 Apr 2007 10:35:14 +0200 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> Message-ID: <4635AA42.1030000@tel.fer.hr> Hi! Gary King wrote: > This should now be corrected; you may need to update metatilities too. I've updated metatilities but now I have a problem compiling them. I don't know if its SBCL (1.0.5.2) or metatilities problem. Here's what I get: ; compiling (DEFUN NICELY-FORMAT-FILENAME ...) ; file: /home/gracin/.sbcl/site/metatilities/dev/utilities/files.lisp ; in: DEFUN NICELY-FORMAT-FILENAME ; (FORMAT STREAM "~(~a~@[.~A~] {~:[...:~]~{~a:~}}~)" ; (PATHNAME-NAME METABANG.UTILITIES::FILE) ; (AND METABANG.UTILITIES::SHOW-TYPE? ; (PATHNAME-TYPE METABANG.UTILITIES::FILE)) ; (AND METABANG.UTILITIES::INITIAL-ELLIPSIS? ; (<= (LENGTH METABANG.UTILITIES::DIRECTORIES) ; METABANG.UTILITIES::DEPTH)) ; (LAST METABANG.UTILITIES::DIRECTORIES METABANG.UTILITIES::DEPTH)) ; --> FORMAT ; ==> ; (FORMATTER "~(~a~@[.~A~] {~:[...:~]~{~a:~}}~)") ; ; caught ERROR: ; (in macroexpansion of (FORMATTER "~(~a~@[.~A~] {~:[...:~]~{~a:~}}~)")) ; (hint: For more precise location, try *BREAK-ON-SIGNALS*.) ; error in FORMAT: must specify exactly two sections ; ~(~a~@[.~A~] {~:[...:~]~{~a:~}}~) ; ^ ; ==> ; (FORMAT SB-C::DEST (FORMATTER "~(~a~@[.~A~] {~:[...:~]~{~a:~}}~)") #:G65 ; #:G66 #:G67 #:G68) ; ; note: The second argument never returns a value. From gracin at tel.fer.hr Mon Apr 30 14:59:43 2007 From: gracin at tel.fer.hr (Josip Gracin) Date: Mon, 30 Apr 2007 16:59:43 +0200 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> Message-ID: <4636045F.70607@tel.fer.hr> Gary King wrote: > This should now be corrected; you may need to update metatilities too. > > Please let me know, Gary, after checking the source code, here's another contrived example which does not work for me: (let ((c (make-container 'priority-queue-on-container))) (insert-item c 2) (insert-item c 1) (insert-item c 3) (delete-element c 2)) From gwking at metabang.com Mon Apr 30 16:06:16 2007 From: gwking at metabang.com (Gary King) Date: Mon, 30 Apr 2007 12:06:16 -0400 Subject: [cl-containers-devel] Problems with priority queues In-Reply-To: <4635AA42.1030000@tel.fer.hr> References: <463105B8.5000806@tel.fer.hr> <3CFB2150-4BD2-470B-853C-F67C3C7EFF68@metabang.com> <4631813E.30001@tel.fer.hr> <4635AA42.1030000@tel.fer.hr> Message-ID: Hi Josip, This hasn't changed in metatilities and it looks to me as if SBCL is confused. The error message looks like it thinks I'm using ~:[. As in: > * (format t "~:[A~;B~]" nil) > A > NIL > * (format t "~:[A~;B~]" t) > B > NIL > * (format t "~:[AB~]" t) > > debugger invoked on a SB-FORMAT:FORMAT-ERROR: > error in FORMAT: must specify exactly two sections > ~:[AB~] > ^ But ~@[ should be OK. What does > (format t "~@[.~a~]" 23) give you? On Apr 30, 2007, at 4:35 AM, Josip Gracin wrote: > ; compiling (DEFUN NICELY-FORMAT-FILENAME ...) > ; file: /home/gracin/.sbcl/site/metatilities/dev/utilities/files.lisp > ; in: DEFUN NICELY-FORMAT-FILENAME > ; (FORMAT STREAM "~(~a~@[.~A~] {~:[...:~]~{~a:~}}~)" > ; (PATHNAME-NAME METABANG.UTILITIES::FILE) > ; (AND METABANG.UTILITIES::SHOW-TYPE? > ; (PATHNAME-TYPE METABANG.UTILITIES::FILE)) > ; (AND METABANG.UTILITIES::INITIAL-ELLIPSIS? > ; (<= (LENGTH METABANG.UTILITIES::DIRECTORIES) > ; METABANG.UTILITIES::DEPTH)) > ; (LAST METABANG.UTILITIES::DIRECTORIES > METABANG.UTILITIES::DEPTH)) > ; --> FORMAT > ; ==> > ; (FORMATTER "~(~a~@[.~A~] {~:[...:~]~{~a:~}}~)") > ; > ; caught ERROR: > ; (in macroexpansion of (FORMATTER "~(~a~@[.~A~] {~:[...:~]~ > {~a:~}}~)")) > ; (hint: For more precise location, try *BREAK-ON-SIGNALS*.) > ; error in FORMAT: must specify exactly two sections > ; ~(~a~@[.~A~] {~:[...:~]~{~a:~}}~) > ; ^ > > ; ==> > ; (FORMAT SB-C::DEST (FORMATTER "~(~a~@[.~A~] {~:[...:~]~{~a:~}} > ~)") #:G65 > ; #:G66 #:G67 #:G68) > ; > ; note: The second argument never returns a value. -- Gary Warren King, metabang.com Cell: (413) 885 9127 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM From gracin at tel.fer.hr Mon Apr 30 16:23:21 2007 From: gracin at tel.fer.hr (Josip Gracin) Date: Mon, 30 Apr 2007 18:23:21 +0200 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> <4635AA42.1030000@tel.fer.hr> Message-ID: <463617F9.7020408@tel.fer.hr> Gary King wrote: > But ~@[ should be OK. What does > >> (format t "~@[.~a~]" 23) > > give you? >> (format t "~@[.~a~]" 23) .23 NIL From gwking at metabang.com Mon Apr 30 18:12:07 2007 From: gwking at metabang.com (Gary King) Date: Mon, 30 Apr 2007 14:12:07 -0400 Subject: [Sbcl-help] [cl-containers-devel] Problems with priority queues In-Reply-To: <87hcqx7r1r.fsf@vasara.proghammer.com> References: <463105B8.5000806@tel.fer.hr> <3CFB2150-4BD2-470B-853C-F67C3C7EFF68@metabang.com> <4631813E.30001@tel.fer.hr> <4635AA42.1030000@tel.fer.hr> <87hcqx7r1r.fsf@vasara.proghammer.com> Message-ID: I used to be confused about why I was confused but it took too much work. Thanks Juho... SBCL keeps getter better and smarter! On Apr 30, 2007, at 12:41 PM, Juho Snellman wrote: > Gary King writes: >> Hi Josip, >> >> This hasn't changed in metatilities and it looks to me as if SBCL is >> confused. The error message looks like it thinks I'm using ~:[. As >> in: >> >>> * (format t "~:[A~;B~]" nil) >>> A >>> NIL >>> * (format t "~:[A~;B~]" t) >>> B >>> NIL >>> * (format t "~:[AB~]" t) >>> >>> debugger invoked on a SB-FORMAT:FORMAT-ERROR: >>> error in FORMAT: must specify exactly two sections >>> ~:[AB~] >>> ^ > > I'm confused about why you think SBCL is confused, since you *are* > using > using ~:[ :-) > >>> ; (FORMAT STREAM "~(~a~@[.~A~] {~:[...:~]~{~a:~}}~)" > ^^^^^^^^^ > > -- > Juho Snellman > -- Gary Warren King, metabang.com Cell: (413) 885 9127 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM From jsnell at iki.fi Mon Apr 30 16:41:52 2007 From: jsnell at iki.fi (Juho Snellman) Date: 30 Apr 2007 19:41:52 +0300 Subject: [Sbcl-help] [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> <4635AA42.1030000@tel.fer.hr> Message-ID: <87hcqx7r1r.fsf@vasara.proghammer.com> Gary King writes: > Hi Josip, > > This hasn't changed in metatilities and it looks to me as if SBCL is > confused. The error message looks like it thinks I'm using ~:[. As in: > > > * (format t "~:[A~;B~]" nil) > > A > > NIL > > * (format t "~:[A~;B~]" t) > > B > > NIL > > * (format t "~:[AB~]" t) > > > > debugger invoked on a SB-FORMAT:FORMAT-ERROR: > > error in FORMAT: must specify exactly two sections > > ~:[AB~] > > ^ I'm confused about why you think SBCL is confused, since you *are* using using ~:[ :-) > > ; (FORMAT STREAM "~(~a~@[.~A~] {~:[...:~]~{~a:~}}~)" ^^^^^^^^^ -- Juho Snellman