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 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-11-03 10:23:10 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: Re: Type System.ADDRESS Date: 3 Nov 1994 18:23:10 GMT Organization: Martin Marietta Orlando Distribution: world Message-ID: <39b9qe$s9b@theopolis.orl.mmc.com> References: <39ahk9$89c@schonberg.cs.nyu.edu> Reply-To: rgilbert@orl.mmc.com NNTP-Posting-Host: alcyone.orl.mmc.com Date: 1994-11-03T18:23:10+00:00 List-Id: In article 89c@schonberg.cs.nyu.edu, dewar@cs.nyu.edu (Robert Dewar) writes: ->Bob, what do you mean by implementing Address as static? this is a use ->of the term static that does not seem to correspond to its technical ->meaning in Ada, and I just don't understand what you mean. Can you give ->a specific example of the problems you are having. -> ->It is certainly legitimate to implement Address as a static subtype, but ->I don't thing this is what you are talking about! The problem appears when using address clauses for either mapping objects to memory and/or associating task entries with an interrupt. Maybe the following example will help: with System; package Address_Clause is type SYSTEM_TYPE is (Ax, Bx); type BASE_ADDR_ARRAY is array (SYSTEM_TYPE) of SYSTEM.ADDRESS; X_Base_Table : constant BASE_ADDR_ARRAY := BASE_ADDR_ARRAY'(Ax => 16#0020_0000#, Bx => 16#0010_0000#); ------------------------------------------------------------- -- In the ultimate implementation, this package would be - -- a generic where the array index (Ax) to identify the - -- system being used, would be a generic parameter supplied - -- by the instantiation. The generic implementation is not - -- shown to avoid unnecessary complications. - ------------------------------------------------------------- XBase : constant SYSTEM.ADDRESS := X_Base_Table(Ax); XAddr_1 : constant SYSTEM.ADDRESS := XBase + 0; X1 : INTEGER; for X1 use at XAddr_1; end Address_Clause; When I compile the above code I get the following error: X1 : INTEGER; for X1 use at XAddr_1; ^1 *** 1 Error 3271: A static expression is expected here (4.9) This is what I feel is an unreasonable limitation. -Bob