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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Alejandro R. Mosteo" Newsgroups: comp.lang.ada Subject: package organization (is this doable?) Date: Fri, 29 Jun 2018 17:45:28 +0200 Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 29 Jun 2018 15:45:29 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="154ade5358ee00eea36a61664f1e81ae"; logging-data="15082"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18FdRj2JeXtDf7inG0l2I6L" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 Cancel-Lock: sha1:NvrLSeGBhy4NlNcHoc4/b0E1wjE= Content-Language: en-US X-Mozilla-News-Host: news://news.eternal-september.org:119 Xref: reader02.eternal-september.org comp.lang.ada:53432 Date: 2018-06-29T17:45:28+02:00 List-Id: So the problem: I'm binding a C library with several types/features that I'm splitting into several Ada packages. These packages must talk to each other sometimes in terms of auxiliary types that I want to hide from the user. Even if I hide these types in a private package, or in the common parent private part, I cannot think of a way of exposing some subprograms in one package to the other, without also exposing them to users. Example: package Lib; -- Root package package Lib.Feat_1; -- Some feature package Lib.Feat_2; -- Another feature private package Lib.Impl; -- Things I want to keep secret, conceptually they're in the private part of Lib IIUC. Am I right that it is impossible for Feat_1 and Feat_2 to communicate using something that's private in Lib or Lib.Impl? That would mean exposing those private types in their respective public parts, which is a no go. Right now I'm moving the things I don't want the user to see to a further child, e.g.: Lib.Feat_1.Impl; Lib.Feat_2.Impl; There, implementation type names/subprograms are visible but the idea is that users never need these packages. And they can call each other. The thing is, I feel like I'm missing some way of organizing things to make what I want possible (that some types are never visible to the user). It feels like a diamond problem in that I need a child of two packages simultaneously (that could be entirely private). Thanks, Álex.