I have not been able to find a generic node class in Squeak. Does Squeak provide a node class similar to the TreeNode class provided by Dolphin Smalltalk? If not, is there a reason why it should not?
Jerome E. Garcia jegarcia@adventurousmind.com
If you think about it, an object **is** a node in a graph, and its instance variables are the arcs! Just as LISP is based on list nodes, OOPLs are based on tree nodes. In fact, the phrase "object **graph**" is in common use.
Of course, a "TreeNode" or "GraphNode" class still has value: it provides both a standard interface/protocol for graph navigation (e.g., what message does one send to get all the arcs (or all the children) of a node), and also a home for graph-theoretic algorithms (e.g, topological sort).
--Alan
Jerome Garcia wrote:
I have not been able to find a generic node class in Squeak. Does Squeak provide a node class similar to the TreeNode class provided by Dolphin Smalltalk? If not, is there a reason why it should not? Jerome E. Garcia jegarcia@adventurousmind.com
I have not been able to find a generic node class in Squeak. Does Squeak provide a node class similar to the TreeNode class provided by Dolphin Smalltalk? If not, is there a reason why it should not?
It doesn't have one, but it's so easy to write one that it doesn't seem necessary to include one in the image.
-- John
John Maloney writes:
It doesn't have one, but it's so easy to write one that it doesn't seem necessary to include one in the image.
Hmm, perhaps Behavior should be a subclass of Node? :)
-C
-- Craig Latta composer and computer scientist craig.latta@netjam.org www.netjam.org latta@interval.com Smalltalkers do: [:it | All with: Class, (And love: it)]
I also realized that trees, a.k.a. Composites, were all over the Smalltalk image. After studying the GOF book and the Smalltalk companion, I took the tack of creating an external iterator that provides all the Collection protocols over a Tree, either top down or bottom up order. This proved to be extremely reusable and useful in iterating through trees. I have not tried to extend it to more general object networks but it seems like a logical thing to do.
jlo
-----Original Message----- From: Jerome Garcia [mailto:Jerome.Garcia@wj.com] Sent: Monday, September 21, 1998 6:48 PM To: squeak@cs.uiuc.edu Subject: Does Squeak include a generic node class?
I have not been able to find a generic node class in Squeak. Does Squeak provide a node class similar to the TreeNode class
provided by Dolphin Smalltalk? If not, is there a reason why it should not?
Jerome E. Garcia jegarcia@adventurousmind.com
squeak-dev@lists.squeakfoundation.org