comp.lang.ada
 help / color / mirror / Atom feed
* Access types == Addresses?
@ 1988-05-04 13:33 howell
  0 siblings, 0 replies; only message in thread
From: howell @ 1988-05-04 13:33 UTC (permalink / raw)


Although some Ada compiler vendors store addresses in access types
(pointers in the Bad Old Days...), it seems to be likely that some would
choose to store dope vectors or pointers to dope vectors in an access
type.  My question is a survey of existing compilers: on how many is it
true that access types == addresses?  The sample pgm below may help answer
the question for a specific compiler.  On Verdix, access types ==
System.address.  Please let me know what your favorite compiler does; I'll
summarize to the net.
Thanks,
 
     Chuck Howell
     The MITRE Corporation, Mail Stop Z645
     7525 Colshire Drive, McLean, VA 22102
     NET:  howell@mitre.arpa or 
           howell%community-chest.mitre.org@gateway.mitre.org
-------------------------------------------------------------
with Text_Io; use Text_Io;
with System;
with Unchecked_Conversion;
procedure Acctst is

    type Ptr is access Integer;

    function Addr_To_Ptr is new Unchecked_Conversion (
        System.Address,  Ptr);

    X : Ptr := new Integer'(42);

begin

    if X = Addr_To_Ptr(X.all'address) then
	Put_Line ("On this compiler, access types == addresses.");
    else
	Put_Line ("On this compiler, access types DO NOT == addresses.");
    end if;

end Acctst;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1988-05-04 13:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1988-05-04 13:33 Access types == Addresses? howell

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