Re: strong connected Graph
Steve Haflich <[email protected]>
| Newsgroups | gmane.lisp.allegro |
|---|---|
| Message-ID | <200301230010.h0N0A5O05312@bach> |
From: feilong <[email protected]> I want to define a strong connected graph with lisp: (let ((graph '(a (b nil . nil) c))) (setf (second (second graph)) (second graph)) (setf (rest (last (second graph))) (rest (rest graph))) graph) but intepreter displays error messages *** - Lisp stack overflow. RESET Why is this graph false? By the way,how can I correct build a strong-connected graph with lisp and how can I such each atom in this graph? There is a subtle violiation here that has nothing to do with your problem. CL does not allow modifying any constant, such as the quoted list in the first line of your example. Your should instead write soemthing like: (let ((graph (list 'a (list 'b nil) 'c))) ...) which guarantees a freshly consed tree that you may safely modify. But that is not important to your immediate question. There is nothing wrong with your graph, except that the top level is trying to print your graph, which has nothing wrong with it, except that the top level is trying to print your graph, which has nothing wrong with it, except that the top level is trying to print your graph, which has nothing wrong with it, except that the top level is trying to print your graph, which has nothing wrong with it, except that the top level is trying to print your graph, which has nothing wrong with it, except that the top level is trying to print your graph ... See the special variable *print-circle*.