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.1 required=5.0 tests=BAYES_40,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!umd5!uflorida!novavax!potpourri!bseymour From: bseymour@potpourri.UUCP (Burch Seymour) Newsgroups: comp.lang.ada Subject: Re: Dynamic Address Clauses?? Message-ID: <1186@potpourri.UUCP> Date: 15 Jun 88 14:10:42 GMT References: <8806011944.AA06549@ti.com> Organization: Gould CSD, Fort Lauderdale, FL List-Id: in article <8806011944.AA06549@ti.com>, LINNIG@eg.csc.ti.COM (Mike Linnig) says: > with SYSTEM; > use SYSTEM; > package DYNAMIC_ADDR is > subtype STUPID is SYSTEM.ADDRESS; > > function DYNAMIC return STUPID; -- just some function > > X: INTEGER; > for X use at DYNAMIC; -- just what does this mean?? What this does on our compiler (Telesoft Telegen II - Gould version) is call function DYNAMIC and store the returned value into X. This is done during the elaboration of the specification of package DYNAMIC_ADDR. Later references to X do not call the function, just use the current value of X. > ANOTHER: INTEGER; > for ANOTHER USE AT stupid(x); > -- this compiles on one compiler and gets illegal conversion type > -- on another one. Why? According to type conversion rules (see LRM section 4.6.8), the operand and target types must be related. The type system.address is implementation specific (LRM 13.7). Some compilers just derive system.address from integer. In this case you can convert integer to address without using unchecked conversion since they have the same base type. On others this is not true and the conversion is illegal. That's why this works on some compilers and not on others. -Burch Seymour- Gould CSD Ft Lauderdale, Fla =====================================================================