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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,691bbbf0ab0cc67e X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: [Q] Returning Strings From A Function Date: 1997/04/05 Message-ID: #1/1 X-Deja-AN: 230940093 References: <33454165.1658515@news.demon.co.uk> <19970405130401.IAA25121@ladder01.news.aol.com> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-04-05T00:00:00+00:00 List-Id: John Herro said, talking of the question about dealing with a variable length string value returned <> Most certainly! The normal solutoin is just to declare a local variable and initialize it with the returned value: x : string := f(x); That's straightforward. If you want to use pointers, then you can use type x is access all string; xv : x; xv := new String'(f(x)); These seems straightforward, so I am not quite sure I understand John Herro's reference to "minor annoyance". In a language designed NOT to require default heap allocation, the Ada semantics seem quite reasonable. I also find John's suggested solutions unnecessarily complex (so perhaps that's why he finds this so annoying :-)