From gwking at metabang.com Fri Feb 10 14:05:27 2006 From: gwking at metabang.com (Gary King) Date: Fri, 10 Feb 2006 09:05:27 -0500 Subject: [cl-containers-devel] Re: bug in cl-containers? In-Reply-To: References: Message-ID: Hi Karol, I will look into this shortly. thanks, On Feb 10, 2006, at 8:00 AM, karol skocik wrote: > Hi Gary, > I wanted to play with your libraries, namely cl-containers, but it > behaves strange on SBCL 0.98/Linux x86 > > When I want to use heap-container, and want to insert new item : > > CL-USER> (defvar *heap* (make-instance 'cl-containers:heap-container)) > *HEAP* > CL-USER> (cl-containers:insert-new-item *heap* 10) > Control stack guard page temporarily disabled: proceed with caution > > In the debugger : > Control stack exhausted (no more space for function call frames). > This > is probably due to heavily nested or infinitely recursive function > calls, or a tail call that SBCL cannot or has not optimized away. > [Condition of type SB-KERNEL::CONTROL-STACK-EXHAUSTED] > > Restarts: > 0: [ABORT-REQUEST] Abort handling SLIME request. > 1: [TERMINATE-THREAD] Terminate this thread (# {B100459}>) > > > Backtrace: > 0: (SB-KERNEL::CONTROL-STACK-EXHAUSTED-ERROR) > 1: ("foreign function: call_into_lisp") > 2: ("foreign function: post_signal_tramp") > 3: (SB-PCL::CHECK-APPLICABLE-KEYWORDS 0 -309154813 2) > 4: ("foreign function: #x0") > 5: ((LAMBDA (SB-PCL::.PV-CELL. SB-PCL::.NEXT-METHOD-CALL. > SB-PCL::.ARG0. SB-PCL::.ARG1. SB-PCL::.DFUN-REST-ARG.)) # printing object>) > 6: ((SB-PCL::FAST-METHOD METABANG.CL-CONTAINERS:INSERT-ITEM > (METABANG.CL-CONTAINERS:HEAP-CONTAINER T)) #) > 7: ((SB-PCL::FAST-METHOD METABANG.CL-CONTAINERS:INSERT-ITEM > (METABANG.CL-CONTAINERS:CONTAINER-USES-NODES-MIXIN T)) # printing > object>) > 8: ((SB-PCL::FAST-METHOD METABANG.CL-CONTAINERS:INSERT-ITEM > (METABANG.CL-CONTAINERS:HEAP-CONTAINER T)) #) > 9: ((SB-PCL::FAST-METHOD METABANG.CL-CONTAINERS:INSERT-ITEM > (METABANG.CL-CONTAINERS:CONTAINER-USES-NODES-MIXIN T)) # printing > object>) > > calls like 8 a 9 are repeating and repeating and repeating.... > > when I use (cl-containers:insert-item *heap* 10) instead, the > result is > the same... > > --- I have posted this on c.l.l., and one guy wrote me this : > > I might be wrong, but I think the following code is incorrect: > (defmethod insert-item ((container container-uses-nodes-mixin) (item > t)) > (let ((node (make-node-for-container container item))) > (values (insert-item container node) > node))) > > Seems like a direct recursion, so one gets a stac overflow. > Substituting the insert-item with call-next-method works for me. > > (defmethod insert-item ((container container-uses-nodes-mixin) (item > t)) > (let ((node (make-node-for-container container item))) > (values (call-next-method container node) > node))) > > Do you think that it is a valid problem? If yes, can you patch the > cl-containers, please? > > Thank you and have a nice day, > Karol -- Gary Warren King metabang.com http://www.metabang.com/ From attila.lendvai at gmail.com Sat Feb 11 15:50:38 2006 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Sat, 11 Feb 2006 16:50:38 +0100 Subject: [cl-containers-devel] simple trees Message-ID: hello all! i am looking for a simple tree implementation, something that suits the usual GUI needs (insertion ordered, parent navigation, any number for child nodes) does anyone have an implementation laying around? i've started to roll my own simple-tree into cl-containers, but it's not nicely integrating yet (well, and doesn't yet work at all). it needs much more work and therefore i tought i'll ask here in the hope that either someone have already done it or that Gary picks up the idea... :) thanks for any info, and for cl-containers of course! - attila (alias 101 on irc &no 'its not lisp code :) From gwking at metabang.com Sun Feb 12 00:51:48 2006 From: gwking at metabang.com (Gary King) Date: Sat, 11 Feb 2006 19:51:48 -0500 Subject: [cl-containers-devel] simple trees In-Reply-To: References: Message-ID: <9359FBD9-5E0F-4B7E-ADCE-71B4AC0CC91B@metabang.com> Hi Attila, Do you mean something that can store the data for an outline or a tree-control? What operations would be necessary for such a best. I can imagine: (let ((outline (make-container 'outline))) (insert-item outline 'a) (insert-item outline 'b) (insert-item (item-at outline 'b) 'c) (insert-item (item-at outline 'b) 'd) (insert-item (item-at (item-at outline 'b) 'd)) 'e) (insert-item (item-at (item-at outline 'b) 'd)) 'f) ;; OR (insert-item (item-at outline 'b 'd) 'f) (insert-item outline 'g) outline) which would make a data structure like this: a b - c d - e f g I think that the data structure would look like (ignoring much type information, etc). (defclass* basic-outline () (children)) (defclass* outline (basic-outline) ()) (defclass* outline-node (basic-outline) (parent)) size --> number of items in the outline (all the nodes, leaf or non-leaf) insert-item / item-at iterate / collect etc. Is this the sort of thing you are looking for? regards, On Feb 11, 2006, at 10:50 AM, Attila Lendvai wrote: > hello all! > > i am looking for a simple tree implementation, something that suits > the usual GUI needs (insertion ordered, parent navigation, any number > for child nodes) > > does anyone have an implementation laying around? > > i've started to roll my own simple-tree into cl-containers, but it's > not nicely integrating yet (well, and doesn't yet work at all). it > needs much more work and therefore i tought i'll ask here in the hope > that either someone have already done it or that Gary picks up the > idea... :) > > thanks for any info, and for cl-containers of course! > > - attila > > (alias 101 on irc &no 'its not lisp code :) > _______________________________________________ > 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 http://www.metabang.com/