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!postnews.google.com!g14g2000cwa.googlegroups.com!not-for-mail From: "jimmaureenrogers@worldnet.att.net" Newsgroups: comp.lang.ada Subject: Re: Why was it done this way ? Date: 26 Oct 2005 19:30:43 -0700 Organization: http://groups.google.com Message-ID: <1130380243.198117.318920@g14g2000cwa.googlegroups.com> References: <%DV7f.13378$rE2.2085@fe10.lga> NNTP-Posting-Host: 69.170.70.49 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1130380250 15350 127.0.0.1 (27 Oct 2005 02:30:50 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 27 Oct 2005 02:30:50 +0000 (UTC) In-Reply-To: <%DV7f.13378$rE2.2085@fe10.lga> User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20040913 Firefox/0.10,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g14g2000cwa.googlegroups.com; posting-host=69.170.70.49; posting-account=SqOfxAwAAAAkL81YAPGH1JdBwpUXw9ZG Xref: g2news1.google.com comp.lang.ada:5975 Date: 2005-10-26T19:30:43-07:00 List-Id: Heimlich Manure wrote: > Hello respectable group, > > This may be a silly question but I'm sure there was reasoning behind > allowing such : > > with Ada.Text_IO; > use Ada.Text_IO; > > procedure My_Example is > task type T1; > task type T2; > > task body T1 is > begin > Put_Line("Instantiating T2 from T1"); > declare > T_2_2 : T2; > begin > null; > end; > end T1; > > task body T2 is > begin > Put_Line("Instantiating T1 from T2"); > declare > T_1_1 : T1; > begin > null; > end; > end T2; > > T_1 : T2; > begin > null; > end My_Example; > > Question is, why is this legit ? What do you think should be wrong with this? Think of instances of tasks as active objects. Each task creates an instance of the other task. Granted, this program will run forever until the stack exhausted. In that manner, this program is a little like a recursive algorithm with no terminating condition. Jim Rogers