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.8 required=5.0 tests=BAYES_00,INVALID_DATE 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-11 09:03:52 PST Path: nntp.gmd.de!Germany.EU.net!EU.net!howland.reston.ans.net!europa.eng.gtefsd.com!news.umbc.edu!eff!blanket.mitre.org!linus.mitre.org!linus!mbunix!emery From: emery@goldfinger.mitre.org (David Emery) Newsgroups: comp.lang.ada Subject: Re: Type System.ADDRESS Date: 3 Nov 94 11:27:06 Organization: The Mitre Corp., Bedford, MA. Distribution: world Message-ID: References: <395ecb$bjq@theopolis.orl.mmc.com> NNTP-Posting-Host: goldfinger.mitre.org In-reply-to: rgilbert@orl.mmc.com's message of 1 Nov 1994 13:04:11 GMT Date: 1994-11-03T11:27:06+00:00 List-Id: > Any assignments to type System.Address require a static expression. This sounds like a compiler bug to me. First, the following is legal Ada, i.e. you can compute arbitrary values of type System.address and assign them to variables of the type: X : system.address; A, B : integer; begin if (some_random_event) then X := A'address; else X := B'address; end if; end; Let's now look at address representation clauses. For instance, given Address A, the address of an integer, the following is legal Ada: I : integer; for I use at A; Ada83 (Ada87) RM, 13.5(2) says that the expression must be a "simple_expression". This is NOT the same as a "static_simple_expression" (e.g. 13.4 (2), alignment_clause for a record representation). Therefore the following is legal Ada (although potentially erroneous): with System; function I_at_addr (addr : System.address) return integer is the_object : integer; for the_object use at addr; begin return the_object; end; dave -- --The preceeding opinions do not necessarily reflect the opinions of --The MITRE Corporation or its sponsors. -- "A good plan violently executed -NOW- is better than a perfect plan -- next week" George Patton -- "Any damn fool can write a plan. It's the execution that gets you -- all screwed up" James Hollingsworth -------------------------------------------------------------------------