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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,999932ecc319322a,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!l41g2000cwc.googlegroups.com!not-for-mail From: spambox@volja.net Newsgroups: comp.lang.ada Subject: advice on package design Date: 7 Mar 2005 08:23:58 -0800 Organization: http://groups.google.com Message-ID: <1110212638.336123.298580@l41g2000cwc.googlegroups.com> NNTP-Posting-Host: 82.192.62.228 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1110212642 4590 127.0.0.1 (7 Mar 2005 16:24:02 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 7 Mar 2005 16:24:02 +0000 (UTC) User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: l41g2000cwc.googlegroups.com; posting-host=82.192.62.228; posting-account=sjoIww0AAACsQsohcnPenkRLTMgYA84g Xref: g2news1.google.com comp.lang.ada:8817 Date: 2005-03-07T08:23:58-08:00 List-Id: Hello, I've written a package for linked list operations for my personal use. After a while I figured I'd write another package for some string operations that I use frequently. On their own, they both work well. Now comes the problem. My string library uses my linked list library, which must be instantiated -- the structure of a node must be supplied. After that, the string library can use procedures from the linked list library. But what about the end user? The linked list library defines a type, say linked_list, and the string library instantiates it something like: type word is record ... package string_ll is new linkedlists(word); use string_ll; Ultimatelly, if some function from my strings package returns a linked_list (as defined in the linked list package), it will be of the type string_ll.linked_list, if we follow the above example. How could it be available for further processing with routines from the linked list package? I could "use string_ll" (exactly as in the package) in my end program, however that's probably a poor design, since the user need not know how something was instantiated in another package. If, on the other hand, I make another instance of linkedlist, I must supply the same argument the string package does ("word" in the above example), but then the resulting linked_list type would be some_new_name.linked_list, which is not compatible with what the string package uses (string_ll.linked_list in the example). What is the correct way of dealing with such problems? Thanks, andrej