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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6aa1ec264ce25142 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.105.38 with SMTP id gj6mr2849222wib.0.1346223536106; Tue, 28 Aug 2012 23:58:56 -0700 (PDT) Path: e9ni69101002wia.0!nntp.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Real syntax problems in Ada Date: Wed, 29 Aug 2012 08:58:59 +0200 Organization: cbb software GmbH Message-ID: References: <1p5r39cusgc1n$.18nj9sytckk6$.dlg@40tude.net> <289703e7-1fba-41ce-b781-9e58ff2ec7df@googlegroups.com> <1w3xr2kbz8a19$.wpfoz4p1j1sb.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-08-29T08:58:59+02:00 List-Id: On Tue, 28 Aug 2012 16:38:26 -0500, Randy Brukardt wrote: > "Dmitry A. Kazakov" wrote in message > news:1w3xr2kbz8a19$.wpfoz4p1j1sb.dlg@40tude.net... >> On Tue, 28 Aug 2012 08:14:15 -0700 (PDT), Adam Beneschan wrote: > ... >> Speaking of generics, the formal parameter declarations could be more >> regular: >> >> generic >> type T ...; >> Object : T; >> >> but >> >> generic >> with procedure Foo ...; >> with package Bar ...; >> >> From formal part one could expect following the pattern: >> >> : [:= ] >> >> On the other hand, it is also clear why one would like to keep it visually >> different from the signature of a subprogram. > > It's not a case of "liking"; without the "with", the syntax would be > ambiguous, as a generic unit can be a subprogram. And remember that Ada is > technically free-form, so the indentation and line-endings are irrelevant. > So > generic > function Foo... > ... No, I meant rather this: generic package P (Foo : function return Integer; Q : package...) is ... instead of generic with function Foo return Integer; with package Q ...; package P is ... The problem with that could be distinguishing generic and non-generic signatures of generic subroutines: generic procedure Baz (X : Integer); Is X here a generic formal object or a plain argument of Baz? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de