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,23dabf88feae3dba X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!bcklog1.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Thu, 22 Jun 2006 18:30:32 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <4fssh9F1ena5jU1@individual.net> <4fva3aF1lff5cU1@individual.net> Subject: Re: Elaboration worries Date: Thu, 22 Jun 2006 18:31:18 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-GLWRgwSFRza0mkc8jz3zH6seXAmHWJCEBALrVJSGKAOjOTZyeADkQ6sdPQ7xtwrGBsII3AweA2nvDWH!3lr25O1OYtep62eSHrYxwVokxmXdo4WtQmte9vOJB6fb83DAn5VkpbdHXr0mvK/SmW8ZU5NecHBG!MB/RDHfvvrbMJQ== X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:4913 Date: 2006-06-22T18:31:18-05:00 List-Id: "Alex R. Mosteo" wrote in message news:4fva3aF1lff5cU1@individual.net... ... > I'm also interested in the "cheating" for I/O, since this seems really a > weak spot. Any other cheats besides the one mentioned by Mr.Duff? Well, I don't cheat, rather I pass in the logging routines to the Preelaborated packages. (This will also work for Pure in Ada 2005.) First, I declare a logging access type: type Logger_Access is access procedure (Message : in String); -- Write a line to the log (if any). And then all of the routines that need to do logging including a Logger parameter: Logger : in Logger_Access := null If Logger is null, nothing is written. Logger_Access is defined so that the profile matches Ada.Text_IO.Put_Line for unit debugging, and it matches the profile of the logging routines that we usually use. Now, you do have to pass this through all of the calls inside of Preelaborated packages. Once you get to a normal package, you can just provide the appropriate logger routine: ... Logger => Ada.Text_IO.Put_Line'Access); And this provides a way to access "normal" stuff from Preelaborared packages. Of course, it only works if the number of such things is rather limited. I should point out that I started using this because I had a need to use different logging techniques in different programs that depended on the same shared library. The fact that it let some of the libraries be Preelaborated was a bonus. Randy.