From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b7dc7082d345b1e1,start X-Google-Attributes: gid103376,public From: Carl Banks Subject: package dependence question Date: 2000/05/29 Message-ID: <8gt19i$1cm8@r02n01.cac.psu.edu>#1/1 X-Deja-AN: 628498505 Sender: CARL W BANKS Organization: Penn State University, Center for Academic Computing Newsgroups: comp.lang.ada X-Authinfo-User: cwb129@psu.edu Date: 2000-05-29T00:00:00+00:00 List-Id: Okay, when I program, I like to construct large, dynamic tree structures. I like my trees to be traversible in any direction, so if you're sitting on a node, you can access its parent or any of its branches. So let's say that a particular tree has a different type of node at each level. For example, type A is the root of the tree. Its branches are of type B. B's branches are of type C, and so on. Let's also say that A, B, and C are not really similar (they are only similar in that they are in the same tree structure, but bear no internal resemblance to each other). A, B, and C really belong in separate packages. However, packages can't with each other, meaning that types A and B can't store access types to each other if they are defined in separate packages. It seems that I have to choose between making the tree traversible in only one direction, or defining A, B, and C in the same package. The best solution I could come up with myself is to make A, B, and C child packages of a package such as Node, and declaring the types A, B, and C (and their access types) in the Node package, while declaring functions and procedures in the child packages Node.A, Node.B, and Node.C. This is somewhat messy, as it leaves the fields of type A open to package Node.B, but at least it isolates the functions and procedures. My question is, is there a better way to define such a doubly- traversible tree, so that different node types need not be defined in the same package? Thanks. -- ___\___ ____\___ \ / .\ \ / .\ |>< Carl < |>< Banks < / \_____)_/ / \______)_/