home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / ada / 3795 < prev    next >
Encoding:
Text File  |  1992-12-22  |  1.2 KB  |  36 lines

  1. Newsgroups: comp.lang.ada
  2. Path: sparky!uunet!widget!brandon
  3. From: brandon@evb.com (Brandon)
  4. Subject: Implementation or LRM driven
  5. Message-ID: <1992Dec22.124210.7098@evb.com>
  6. Organization: SETT Inc.
  7. Date: Tue, 22 Dec 1992 12:42:10 GMT
  8. Lines: 26
  9.  
  10. I have been trying to determine any rules either in AI's, LRM or other sources
  11. in how a compiler is permitted to allocate/deallocate return values for functions.
  12.  
  13. When the information is returned from a function some space must be allocated, 
  14. and placed on the call stack.  In the case of a function returning a non-scalar
  15. when MUST that space be deallocated (or can an implemenation lose it).  I've
  16. seen many cases and can not find a specific rule.
  17.  
  18. As a second question, in this example:
  19.     subtype MYSTR is STRING(1..50);
  20.     function Str(X: in INTEGER) return MYSTR;
  21.  
  22.     X: BUFFER(1..200);
  23.     X := Str(1) & Str(2) & Str(3) & Str(4);    <---- here
  24.  
  25.     During the "&" operations being called is the memory being
  26.     used 50+50+100+50+150+50+200 = 650 allowably, unavoidable, or
  27.     completely implementation dependent.
  28.  
  29. Any references would be appreciated
  30.  
  31. -- 
  32. Office Automation, n.:
  33.     The use of computers to improve efficiency by removing anyone
  34.     you would want to talk with over coffee.
  35.  
  36.