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,524141c627466522 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-09-21 05:37:32 PST Newsgroups: comp.lang.ada Path: bga.com!news.sprintlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!MathWorks.Com!noc.near.net!inmet!dsd!bobduff From: bobduff@dsd.camb.inmet.com (Bob Duff) Subject: Re: Experiences/history of Aetech Ada compiler? Message-ID: Sender: news@inmet.camb.inmet.com Organization: Intermetrics, Inc. References: <358gnp$1lm@goanna.cs.rmit.oz.au> <19940919111103.RLOKER01@rlokerson9.ess.harris.com> Date: Tue, 20 Sep 1994 13:19:38 GMT Date: 1994-09-20T13:19:38+00:00 List-Id: In article <19940919111103.RLOKER01@rlokerson9.ess.harris.com>, Robert C. Lokerson 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.)