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.6 required=5.0 tests=BAYES_00,DATE_IN_PAST_24_48, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,83568e4f0ce7998e X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Received: by 10.180.19.166 with SMTP id g6mr1678910wie.4.1351478332050; Sun, 28 Oct 2012 19:38:52 -0700 (PDT) Path: q13ni92136wii.0!nntp.google.com!feeder1.cambriumusenet.nl!feeder2.cambriumusenet.nl!81.171.88.15.MISMATCH!lightspeed.eweka.nl!82.197.223.103.MISMATCH!feeder3.cambriumusenet.nl!feed.tweaknews.nl!81.171.88.16.MISMATCH!eweka.nl!hq-usenetpeers.eweka.nl!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!newsreader4.netcologne.de!news.netcologne.de!newsfeed.straub-nv.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Alternative syntax for function definitions? Date: Sat, 27 Oct 2012 09:49:04 +0200 Organization: Ada @ Home Message-ID: References: NNTP-Posting-Host: b7NxRzGgpBNKFlvVWk2OfA.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.02 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Date: 2012-10-27T09:49:04+02:00 List-Id: Le Sat, 27 Oct 2012 09:11:28 +0200, Dmitry A. Kazakov = a =C3=A9crit: >> I feel it would be the most relevant when having a list of accessors >> functions, like in >> >> function P1 (A : A_Type) return T1; >> function P2 (A : A_Type) return T2; >> function P3 (A : A_Type) return T3; >> function P4 (A : A_Type) return T4; >> function P5 (A : A_Type) return T5; > > The type A_Type should simply implement a record interface: > > type A_Type is ... and record > P1 : T1; > P2 : T2; > ... > P5 : T5; > end record; > ... > private > ... -- functions implementing "components" P1..P5 You got the point (I was precisely thinking of functions define on priva= te = type, that is, the record is not exposed), but unless I missed it, there= = is nothing like a function implementing the access to a record component= = in Ada. I agree that would be the best, but less likely to be done (we = already have dotted notation for function designation, but only for tagg= ed = types). -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univers= ity