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: 103376,be6cbf679aee02c X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Why was it done this way ? Date: 27 Oct 2005 11:07:14 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <%DV7f.13378$rE2.2085@fe10.lga> <43609fe2$0$22537$9b4e6d93@newsread4.arcor-online.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1130425634 11014 192.74.137.71 (27 Oct 2005 15:07:14 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 27 Oct 2005 15:07:14 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:5993 Date: 2005-10-27T11:07:14-04:00 List-Id: Georg Bauhaus writes: > I think it might be difficult in general to detect mutual > recursion, but IANALL ... It is a language design principle that the compiler should be able to detect legality errors by looking only at the current compilation unit, and things it depends upon semantically. In particular, the compiler shouldn't have to look at other package bodies. The mutually recursive tasks could be separately compiled. There are a few exceptions to this principle (see "Post-Compilation Rules" in the RM). These are deliberately kept to a minimum. As JPR pointed out, the goal of the rule (that the task type name denotes the task when inside it) is _not_ to prevent recursion. It is simply a convenient way to refer to the current instance. The same rule applies to records and generic units. The language could have been designed to have special syntax for this case (something like "this T1"). Anyway, recursion (mutual or otherwise) of tasks is useful (in rare cases), so it would be annoying if it were forbidden. It might be nice to detect _infinite_ recursion of tasks (or of procedures, for that matter), but that's impossible in the general case. I believe GNAT is capable of printing a warning on _some_ infinite recursions (of procedures). - Bob