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.9 required=5.0 tests=BAYES_00, T_FILL_THIS_FORM_SHORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ea0955083361ce29,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-22 04:25:51 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!news.freenet.de!not-for-mail From: see@messagebody.com (Jan) Newsgroups: comp.lang.ada Subject: unconstrained records Date: Sun, 22 Dec 2002 12:24:18 GMT Message-ID: <3e05aebf.3122500@news.freenet.de> X-Newsreader: Forte Free Agent 1.21/32.243 NNTP-Posting-Host: 213.7.193.3 X-Trace: 1040559932 news.freenet.de 29795 213.7.193.3:1033 X-Complaints-To: abuse@freenet.de Xref: archiver1.google.com comp.lang.ada:32191 Date: 2002-12-22T12:24:18+00:00 List-Id: Hi, I have found an interesting source code in the book "Ada in action", but the book could be better, because there is no background information. Here is the problem: procedure UnConstrained_Record is type Test (length : natural := 0) is record text : string (1..length); end record; name : Test; begin name := (5, "Bimbo"); -- now I can resize the array inside the record name := (14, "This is a test"); -- but now it comes name := (3, "abc"); -- What happens to the memory? Are the 11 bytes freed -- automatically? end UnConstrained_Record; Thanks!