From: bobduff@dsd.camb.inmet.com (Bob Duff)
Subject: Re: Experiences/history of Aetech Ada compiler?
Date: Tue, 20 Sep 1994 13:19:38 GMT
Date: 1994-09-20T13:19:38+00:00 [thread overview]
Message-ID: <CwFJor.9Hx@inmet.camb.inmet.com> (raw)
In-Reply-To: 19940919111103.RLOKER01@rlokerson9.ess.harris.com
In article <19940919111103.RLOKER01@rlokerson9.ess.harris.com>,
Robert C. Lokerson <RLOKER01@HARRIS.COM> wrote:
>My personal style of programming has evolved into one which uses a lot of
>arrays of pointers to constant strings of varying lengths. I have not been
>able to get this compiler to properly construct them unless they are created
>at run time with the "access" type scheme. This might be ok (and in the ADA
>spirit) but I wish I could have "all" the initializations happen at
>elaboration-time. (If thay makes any sense... I don't really consider myself
>an ADA expert... Much as I would like to be)
In Ada 9X, you can do things like this:
type String_Ptr is access constant String;
type String_Table is array(Positive range <>) of String_Ptr;
X: String_Table :=
( new String'("Hello, world."),
new String'("Goodbye, cruel world."),
new String'("Another message.") );
Since String_Ptr is an access-to-constant type, the compiler should
allocate the above stuff statically. This works in part because
Unchecked_Deallocation is not allowed for access-to-constant types.
--
Bob Duff bobduff@inmet.com
Oak Tree Software, Inc.
Ada 9X Mapping/Revision Team (Intermetrics, Inc.)
prev parent reply other threads:[~1994-09-20 13:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1994-09-15 3:57 Experiences/history of Aetech Ada compiler? Dale Stanbrough
1994-09-15 4:37 ` Experiences/history of Aetech Ada compiler? (more details!) Dale Stanbrough
1994-09-15 16:25 ` Experiences/history of Aetech Ada compiler? Jeff Creem
1994-09-19 15:11 ` Robert C. Lokerson
1994-09-20 13:19 ` Bob Duff [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