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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.180.85.5 with SMTP id d5mr3168207wiz.0.1367959228391; Tue, 07 May 2013 13:40:28 -0700 (PDT) Path: border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!17no5326134wie.0!news-out.google.com!p18ni83163wiv.0!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!195.62.100.242.MISMATCH!newsfeed.kamp.net!newsfeed.kamp.net!gegeweb.org!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: Seeking for papers about tagged types vs access to subprograms Date: Tue, 07 May 2013 22:40:13 +0200 Organization: Ada @ Home Message-ID: References: <1luaso698dpcc$.rrv8385qwl92.dlg@40tude.net> NNTP-Posting-Host: /5uFWkegPs0CGJSoRIUiIw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.15 (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 X-Original-Bytes: 2919 Xref: number.nntp.dca.giganews.com comp.lang.ada:181489 Date: 2013-05-07T22:40:13+02:00 List-Id: Le Tue, 07 May 2013 22:27:58 +0200, Jacob Sparre Andersen news = a =C3=A9crit: > "Dmitry A. Kazakov" wrote in message > news:1luaso698dpcc$.rrv8385qwl92.dlg@40tude.net... >>> On Mon, 6 May 2013 20:09:46 -0500, Randy Brukardt wrote: >>> >>>> The idea of indexing a numeric type is silly, >>> >>> Not at all, consider Unit type declared modular because it has to be= = >>> used >>> as a discriminant. At the same time Unit is a composite of powers fo= r >>> mass, >>> time, current, temperature etc. One would like to have it indexed = >>> (viewed >>> as an array or as a record). > > It might make sense to view it as a record (a capability not in Ada = > 2012), > but it makes little sense to view it as an array (a list of identical > components indexed by a potentially *computed* index). There are a lot= of > abuses of arrays out there that would be much better written as record= s. Look at the deflate specification (RFC 1951), this makes sense with it t= o = see modular types as an array of bits. Anyway, user=E2=80=91defined inde= xing is = supposed to be a client=E2=80=91side interface to some data type, most l= ikely and = allowed to be opaque, so what makes the less sense, is assertions about = = what the underlying type should be. -- = =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