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.0 required=5.0 tests=BAYES_00,DATE_IN_PAST_24_48, REPLYTO_WITHOUT_TO_CC 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,ASCII Received: by 10.180.85.98 with SMTP id g2mr1682223wiz.0.1351478332180; Sun, 28 Oct 2012 19:38:52 -0700 (PDT) Path: q13ni92136wii.0!nntp.google.com!feeder1.cambriumusenet.nl!feeder3.cambriumusenet.nl!feed.tweaknews.nl!81.171.88.16.MISMATCH!eweka.nl!hq-usenetpeers.eweka.nl!xlned.com!feeder3.xlned.com!news.astraweb.com!border6.a.newsrouter.astraweb.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!newsreader4.netcologne.de!news.netcologne.de!news.albasani.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Alternative syntax for function definitions? Date: Sat, 27 Oct 2012 10:37:11 +0200 Organization: cbb software GmbH Message-ID: References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: pSb85Ij4EqcuHDcWtw64BQ.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="iso-8859-1" Content-Transfer-Encoding: 8bit Date: 2012-10-27T10:37:11+02:00 List-Id: On Sat, 27 Oct 2012 09:49:04 +0200, Yannick Duch�ne (Hibou57) wrote: > Le Sat, 27 Oct 2012 09:11:28 +0200, Dmitry A. Kazakov > a �crit: >>> 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 private > 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 know. The point is that there are underlying concepts Ada's type system fails to capture. The language was already suffered dearly from plastic surgeries to get another one. > I agree that would be the best, but less likely to be done (we > already have dotted notation for function designation, but only for tagged > types). That is no problem. All types should have classes anyway. The dotted notation itself is an implementation of some record interface. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de