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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,73175d2d01a1b1dd X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news4.google.com!feeder.news-service.com!weretis.net!feeder4.news.weretis.net!news.tornevall.net!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: subprogram must not be deeper than access type Date: Sun, 25 Sep 2011 10:16:29 -0700 Organization: TornevallNET - http://news.tornevall.net Message-ID: References: NNTP-Posting-Host: 850be4afcf35353f5ebf1fd7bcaa530f Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: fc27af19718efbf74928bbaecbf31d7b X-Complaints-To: abuse@tornevall.net User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.21) Gecko/20110831 Thunderbird/3.1.13 X-Complaints-Language: Spoken language is english or swedish - NOT ITALIAN, FRENCH, GERMAN OR ANY OTHER LANGUAGE! In-Reply-To: X-UserIDNumber: 1738 X-Validate-Post: http://news.tornevall.net/validate.php?trace=fc27af19718efbf74928bbaecbf31d7b X-Complaints-Italiano: Non abbiamo padronanza della lingua italiana - se mandate una email scrivete solo in Inglese, grazie X-Posting-User: 0243687135df8c4b260dd4a9a93c79bd Xref: g2news2.google.com comp.lang.ada:22064 Date: 2011-09-25T10:16:29-07:00 List-Id: On 09/25/2011 02:02 AM, Natasha Kerensikova wrote: > > I'm encountering the error in the subject, "subprogram must not be > deeper than access type", and while I understand what it means in > general and the rationale, I'm lost on why it applies to my code and how > to work around it. The problem is that there is nothing special about the main-program procedure. Specifically, it could be withed and called from something else, or call itself recursively. In either case, its declarative region, with its declaration of the function, would be nested deeper than the declaration of the access type. Since this is a compile-time check, it rejects anything that might be deeper, even when it never is. The basic rule with named access-to-subprogram types is that the actual subprogram must be declared in a library-level package. -- Jeff Carter "Every sperm is sacred." Monty Python's the Meaning of Life 55