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,6aa1ec264ce25142 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.232.1 with SMTP id tk1mr2728188pbc.7.1346189910970; Tue, 28 Aug 2012 14:38:30 -0700 (PDT) MIME-Version: 1.0 Path: a8ni75122869pbd.1!nntp.google.com!npeer03.iad.highwinds-media.com!feed-me.highwinds-media.com!cyclone03.ams2.highwinds-media.com!news.highwinds-media.com!voer-me.highwinds-media.com!news.unit0.net!feeder.erje.net!newsfeed.straub-nv.de!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Real syntax problems in Ada Date: Tue, 28 Aug 2012 16:38:26 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <1p5r39cusgc1n$.18nj9sytckk6$.dlg@40tude.net> <289703e7-1fba-41ce-b781-9e58ff2ec7df@googlegroups.com> <1w3xr2kbz8a19$.wpfoz4p1j1sb.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1346189909 18855 69.95.181.76 (28 Aug 2012 21:38:29 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 28 Aug 2012 21:38:29 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Received-Bytes: 2532 Date: 2012-08-28T16:38:26-05:00 List-Id: "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... ... Is this a generic function with an empty formal part, or a generic formal subprogram parameter? Without the "with", you can't tell. You'd need a lot of lookahead to figure this out, and clearly such a syntax would be error-prone. (Argubly, it's already error-prone, given that I forget the "with" roughly 50% of the time and get weird compiler errors, but it certainly would be worse without it.) Randy.