From: rgilbert@orl.mmc.com (Bob Gilbert)
Subject: Re: Type System.ADDRESS
Date: 3 Nov 1994 18:23:10 GMT
Date: 1994-11-03T18:23:10+00:00 [thread overview]
Message-ID: <39b9qe$s9b@theopolis.orl.mmc.com> (raw)
In-Reply-To: 39ahk9$89c@schonberg.cs.nyu.edu
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
prev parent reply other threads:[~1994-11-03 18:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
1994-10-31 20:28 Type System.ADDRESS Bob Gilbert
1994-11-01 3:11 ` Tucker Taft
1994-11-01 13:04 ` Bob Gilbert
1994-11-01 23:04 ` Norman H. Cohen
1994-11-02 5:51 ` Tucker Taft
1994-11-02 15:45 ` Bob Gilbert
1994-11-07 11:22 ` David Emery
1994-11-03 11:27 ` David Emery
1994-11-03 11:31 ` Robert Dewar
1994-11-03 10:08 ` Robert I. Eachus
1994-11-03 11:30 ` Robert Dewar
1994-11-03 18:23 ` Bob Gilbert [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox