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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.52.36.211 with SMTP id s19mr6319204vdj.7.1403460181584; Sun, 22 Jun 2014 11:03:01 -0700 (PDT) X-Received: by 10.140.49.68 with SMTP id p62mr1045qga.21.1403460181537; Sun, 22 Jun 2014 11:03:01 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!i13no9353539qae.1!news-out.google.com!a8ni10892qaq.1!nntp.google.com!w8no9607866qac.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 22 Jun 2014 11:03:01 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=109.233.148.43; posting-account=ZoAlyAoAAACOOtSiXyaM8n3y8T4ScfeH NNTP-Posting-Host: 109.233.148.43 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Function definitions - with clarification From: montgrimpulo Injection-Date: Sun, 22 Jun 2014 18:03:01 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Received-Bytes: 2423 X-Received-Body-CRC: 1471852697 Xref: news.eternal-september.org comp.lang.ada:20520 Date: 2014-06-22T11:03:01-07:00 List-Id: Direct reply to Shark8 What is the point of saying "the above won't work" when it was obviously forgotten to indicate a type ? What is the point of changing my function F into a procedure F with an embedded procedure G ? This does not make sense at all. What is then left as your contribution ? On Sunday, June 22, 2014 7:45:40 PM UTC+2, Shark8 wrote: > On 22-Jun-14 05:34, montgrimpulo wrote: > > > type Individual (P, Q, R) is record > > > X : x_array (0..P); > > > Y : y_array (0..Q); > > > Z : z_array (0..R); > > > end record; > > > > The above won't work, your discriminants have no type-indication -- how > > is the compiler supposed to know what P, Q, and R are in the context of > > the type? > > > > It;s a lot like nested scopes the following won't work because the new > > definition of X has no type; > > > > Procedure F(X: in Integer) is > > Procedure G is > > X; -- Variable declaration missing type. > > begin > > null; > > end G; > > begin > > null; > > end F; > > > > You want that to be like this: > > > > type Individual (P, Q, R : Positive) is record > > X : x_array (0..P); > > Y : y_array (0..Q); > > Z : z_array (0..R); > > end record;