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=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,39579ad87542da0e X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 X-Received: by 10.180.210.161 with SMTP id mv1mr1637810wic.1.1368583202271; Tue, 14 May 2013 19:00:02 -0700 (PDT) Path: hg5ni110146wib.1!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!216.196.110.144.MISMATCH!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.news.ucla.edu!nrc-news.nrc.ca!News.Dal.Ca!news.litech.org!news.stack.nl!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: Wed, 08 May 2013 11:39:23 +0200 Organization: Ada @ Home Message-ID: References: <17ceq51ydy3s0.s94miqqzbg5w.dlg@40tude.net> <1vrhb7oc4qbob$.q02vuouyovp5$.dlg@40tude.net> <19lrzzbgm77v6.1dzpgqckptaj6.dlg@40tude.net> <1bfhq7jo34xpi.p8n2vq6yjsea.dlg@40tude.net> NNTP-Posting-Host: 7OQr3E3VjE1ZKDv7Xqqyjg.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 Date: 2013-05-08T11:39:23+02:00 List-Id: Le Wed, 08 May 2013 10:23:48 +0200, Dmitry A. Kazakov = a =C3=A9crit: > BTW, range should become a proper type. That is the problem of paralle= l > type hierarchies. I.e. describing relationships of unrelated yet bound= to > each other types, like index, range, array, slice, element. There shou= ld = > be some general mechanism to handle such clouds of types. That would come as natural. Just to stay with the range case, this would= = allow to have range object (we only have the range attribute, which is a= n = UFO in the overall Ada entities model), without being forced to = de=E2=80=91structure it (as with some `First` and `Last` argument to a = sub=E2=80=91program), which would come with added safety at some place. = This would = permit proper functions and operations on ranges. I also noted some Ada = = new=E2=80=91comers sometime feel surprised there is no way to pass or de= clare a = range object in Ada, =E2=80=A6 that's indeed surprising, as there is a r= ange = attribute. Creating the glue between an array type and a range type is straight awa= y = actually with Ada, but a more general model could be type properties. Th= is = would allow to declare things in a more readable and reliable way: -- Fictitious example, not real Ada A : Array_Type; I : A'Index_Type; -- As an attribute of an object J : Array_Type.Index_Type; -- As a member of a type. May be an idea for something similar with primitive operations: -- Fictitious example, not real Ada function Implicit_Indexing (A : Array_Type; -- An array type or an array interface I : A'Index_Type) return A'Element_Type; That would bind things together, and provide a more general model tan = per=E2=80=91type adhoc tricks (would help, if you want types at library = level). But then, an example such as the above would present challenge with = derived types. > BTW, range should become a proper type. That is the problem of paralle= l > type hierarchies. I.e. describing relationships of unrelated yet bound= to > each other types Not everything is bound to each=E2=80=91other, there is a dependency ord= er. When = not, this means this is a [co=E2=80=91]recursive structure, and there is= already = incomplete declarations for this (the most natural I think). -- = =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