comp.lang.ada
 help / color / mirror / Atom feed
From: bseymour@potpourri.UUCP (Burch Seymour)
Subject: Re: Dynamic Address Clauses??
Date: 15 Jun 88 14:10:42 GMT	[thread overview]
Message-ID: <1186@potpourri.UUCP> (raw)
In-Reply-To: 8806011944.AA06549@ti.com

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
=====================================================================

  parent reply	other threads:[~1988-06-15 14:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1988-06-01 15:12 Dynamic Address Clauses?? Mike Linnig
1988-06-02 12:39 ` Robert Firth
1988-06-10 14:38   ` stt
1988-06-15 21:19     ` Ron Guilmette
1988-06-03  6:02 ` Ron Guilmette
1988-06-03 14:52   ` markb
1988-06-06 12:33   ` David Collier-Brown
1988-06-08 18:52     ` Ron Guilmette
1988-06-10 19:22       ` Steve Hyland
1988-06-15 12:26       ` David Collier-Brown
1988-06-15 14:10 ` Burch Seymour [this message]
  -- strict thread matches above, loose matches on Subject: below --
1988-06-10 15:42 Jim Moody, DCA C342
1988-06-16 13:53 David E. Emery
1988-06-17  4:13 ` Richard A. O'Keefe
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox