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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Path: border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.glorb.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!fx28.iad.POSTED!not-for-mail From: Shark8 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:32.0) Gecko/20100101 Thunderbird/32.0a1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Function definitions - with clarification References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Message-ID: X-Complaints-To: abuse@teranews.com NNTP-Posting-Date: Sun, 22 Jun 2014 19:55:30 UTC Organization: TeraNews.com Date: Sun, 22 Jun 2014 13:55:29 -0600 X-Received-Bytes: 2352 X-Received-Body-CRC: 3021843695 X-Original-Bytes: 2656 Xref: number.nntp.dca.giganews.com comp.lang.ada:187166 Date: 2014-06-22T13:55:29-06:00 List-Id: On 22-Jun-14 12:03, montgrimpulo wrote: > Direct reply to Shark8 > > What is the point of saying "the above won't work" when it was > obviously forgotten to indicate a type? That's exactly the point. If you're giving us incorrect stuff then it's hard to determine what your intent really is. This is opposed to either writing out psudo-code OR non-compiling code within otherwise syntactically-correct code [i.e "what's the syntax for..."]. IOW, the intent is a necessary, but not sufficient condition for others to understand/help. To further clarify, there's the high-level intent of problem description, which you've given; but there's also the intent with respect as to how you are going to implement the solution. (As I pointed out earlier, you could have used generic-parameters on your solution OR discriminated record. Both are equally valid for a solution.) > What is the point of changing my > function F into a procedure F with an embedded procedure G ? To show that there are different scopes and you cannot have a name infer types from outer scopes... which is what it really looked like you were trying to do by having the discriminants w/o type. (It's also a bad idea for you to be relying on parameter/variable values in type/subtype definitions, until you really understand the implications.) > This does not make sense at all. > What is then left as your contribution? If you don't want my help, you don't have to take it.