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: a07f3367d7,6aa1ec264ce25142 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.82.226 with SMTP id l2mr5146245wiy.1.1346980966227; Thu, 06 Sep 2012 18:22:46 -0700 (PDT) Path: q11ni5513255wiw.1!nntp.google.com!feeder3.cambriumusenet.nl!feeder1.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.139.MISMATCH!xlned.com!feeder7.xlned.com!newsfeed10.multikabel.net!multikabel.net!newsfeed20.multikabel.net!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsreader4.netcologne.de!news.netcologne.de!newsfeed.straub-nv.de!feed.xsnews.nl!border-1.ams.xsnews.nl!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Thu, 30 Aug 2012 11:12:32 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Real syntax problems in Ada References: <1p5r39cusgc1n$.18nj9sytckk6$.dlg@40tude.net> <289703e7-1fba-41ce-b781-9e58ff2ec7df@googlegroups.com> <1w3xr2kbz8a19$.wpfoz4p1j1sb.dlg@40tude.net> <503e1a1d$0$6572$9b4e6d93@newsspool3.arcor-online.net> In-Reply-To: Message-ID: <503f2e7f$0$6580$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 30 Aug 2012 11:12:31 CEST NNTP-Posting-Host: 041f2b6b.newsspool3.arcor-online.net X-Trace: DXC=F?M5F;85Xki^Y=RbYBPl4`McF=Q^Z^V3h4Fo<]lROoRa8kFejVhM;1O_4YFKVdWY3\YmUB] On 29.08.12 19:51, stefan-lucks@see-the.signature wrote: > On Wed, 29 Aug 2012, Georg Bauhaus wrote: > >> On 29.08.12 12:43, stefan-lucks@see-the.signature wrote: >>> generic >>> type Item is private; >>> type Many_Items is array(Positive range <>) of Item; >>> with function "<"(Left, Right: Item) return Boolean is <>; >>> function Minimum(List: Many_Items) return Item; >>> >>> Ask programmers without Ada experience what this is. Most would read this >>> as a generic declaration of something -- but how many would read this as >>> the generic declaration of a function called "Minimum"? >> >> It is good to see a reference to at least one of the touchstones >> of readability. > > What do you mean by "touchstones of readability"? I mean programmers reading source text. Someone has mentioned a controlled experiment. Readers could demonstrate how well they have understood what they have read. > In any case. "Normal" declarations have *first* what is declared (e.g., > "function", then the name, and then the parameter list. Which is logical > -- you first need to know what is declared, before you care about the > parameter list. Yes, and jumping back and forth means reading is not linear. There might be readers, though, who would rather see a function name and its profile declared without something in between, interrupting the linear flow of thought (about function). (Incidentally, would context clauses have to come after what is declared, too? When I see context clauses, I know what to expect. Arguably, "generic" serves a similar purpose.) In any case, generic function Minimum (type Item is private; type Many_Items is Array (Natural Range <>) of Item; function "<"(Left, Right: Item) return Boolean is <>) <> (List: Many_Items) return Item; might be another way to indicate where the reader may find the declared function's profile.