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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c733905936c6b6b0 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.143.143 with SMTP id v15mr1515673bku.8.1334648807990; Tue, 17 Apr 2012 00:46:47 -0700 (PDT) Path: h15ni133092bkw.0!nntp.google.com!news2.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!ecngs!feeder2.ecngs.de!87.79.20.101.MISMATCH!newsreader4.netcologne.de!news.netcologne.de!newsfeed.straub-nv.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Tue, 17 Apr 2012 09:46:38 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: [OT] interesting reason why a language is considered good References: <8603135.951.1334573001928.JavaMail.geo-discussion-forums@vbbdy9> <4f8c06f5$0$7617$9b4e6d93@newsspool1.arcor-online.net> <14veb9cpamoda.ck9fbsd5m9m$.dlg@40tude.net> <4f8c3431$0$7627$9b4e6d93@newsspool1.arcor-online.net> <4f8c52b2$0$7627$9b4e6d93@newsspool1.arcor-online.net> <9s7d2eufbh6f$.1ivcyxfztaq42$.dlg@40tude.net> <4f8c93a0$0$6638$9b4e6d93@newsspool2.arcor-online.net> In-Reply-To: Message-ID: <4f8d1fdf$0$6638$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 17 Apr 2012 09:46:39 CEST NNTP-Posting-Host: 46b483c9.newsspool2.arcor-online.net X-Trace: DXC=Q0kWToeVHg`:i=48;n?Z:`A9EHlD;3Ycb4Fo<]lROoRa8kFejVh:iWoJ3fm49k;UWeKi6gV5a X-Complaints-To: usenet-abuse@arcor.de Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-04-17T09:46:39+02:00 List-Id: On 17.04.12 05:43, Randy Brukardt wrote: > Ada requires the names of the parameters to be > those used in *calls*. Yes. In case there is a callable. > ... The solution is to define the > parameter names as needed for readability in calls, and then (if those names > are problematic in the body), rename them for use in the body: > > Exit_Time : Time renames When; > > ... >> begin >> while Now< Scheduled_Departure loop >> delay Pausing_Time; >> Now := Clock; >> end loop; >> Actual_Departure (Minute_Of (Scheduled_Departure)) := Now; >> end Leave; > > Unfortunately, this solution makes insanely wordy calls: > > Leave (Scheduled_Departure => Now); > > In many cases, the parameter names overwhelm the actual values. So, if Exit_Time is what you'd choose to denote the kind of time you have in mind, what about Leave (Exit_Time => Now) ? To me, "Exit_Time" says a lot more than "when" in any case! Why this insistence on "when"? There is an curious phenomenon here: everyone seems to be concentrating on parameter names. A case in which there is context. So there is - a unanimous vote in case of parameters: "when" is great! - a workaround for some other cases (but not aggregates, ...) - thoughtful considerations Still no answer to the question about a fraction of programs profiting from identifiers "when" and "others", so much that they should be allowed. I'd challenge, if I may, the compiler writers: Would you compiler writers honestly prefer to write code like for some access in record => when(access) = array(of); when when > at => accept record (type) do task.type := type; done; Trying to understand the source text requires constantly switching levels of meanings of the words. Does it really help? Nevertheless, I'd add expression functions to the set of solutions, which now only includes (re)naming of objects. A kind of the LET expressions: function Outer (par1, par2: T) return T is function flap return T is (par1 + globalN); function fluff return T is (((par2 + par1)) / 2 * flap); begin return flap * fluff; end Outer