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=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5850c59062ca527a,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-31 15:22:40 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!csn!boulder!news.coop.net!news.den.mmc.com!iplmail.orl.mmc.com!alcyone!rgilbert From: rgilbert@orl.mmc.com (Bob Gilbert) Newsgroups: comp.lang.ada Subject: Type System.ADDRESS Date: 31 Oct 1994 20:28:24 GMT Organization: Martin Marietta Orlando Distribution: world Message-ID: <393k18$huv@theopolis.orl.mmc.com> Reply-To: rgilbert@orl.mmc.com NNTP-Posting-Host: alcyone.orl.mmc.com Date: 1994-10-31T20:28:24+00:00 List-Id: I've run across a problem and would like a little net wisdom on this... The compiler I'm working with has choosen to implement the type System.ADDRESS as static. Although this appears to be within the rules of the LRM, it does present some significant limitations. 1) It has been a frequent practice of mine to implement drivers for memory mapped devices using a generic, where the base address of the device is supplied as a generic parameter. This has allowed for nice reusable Ada components. Unfortunately,with a static implementation of type System.ADDRESS, a representation clause cannot use the generic base address supplied. 2) Similar to the above example, I've also used generics packages containing tasks associated with an interrupt, where the interrupt is either directly or indirectly determined by the generic parameters. Again, a static implementation of System.ADDRESS won't allow this. Now I've worked around the first problem by using access types and Unchecked_Conversion to map the generic objects, and I reconize that this is sort of a bastard implementation that makes assumptions as to the implementation of the access type (not necessarily portable). I've worked around the second problem by creating task types for each possible interrupt, and then dynamically allocate the appropiate task object in the generic. But this ends up looking somewhat silly as I have many tasks types defined that are all identical except for their address clause used to associate the interrupt (ends up looking like I should have used a generic, so I end up writting extra comments to explain why I didn't). My questions are then: Is it reasonable for a compiler to implement System.ADDRESS as static? Is it reasonable for the language to allow this? Is there a better way to work around the limitations? Thanks, Bob