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.109.111 with SMTP id hr15mr1645630wib.1.1368583667606; Tue, 14 May 2013 19:07:47 -0700 (PDT) Path: p18ni110084wiv.0!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!border2.nntp.ams2.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: Fri, 10 May 2013 17:11:40 +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> <12gn9wvv1gwfk.10ikfju4rzmnj.dlg@40tude.net> <1oy5rmprgawqs.1jz36okze0xju$.dlg@40tude.net> NNTP-Posting-Host: uGUognJZXpdb++Da0QvCqg.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-10T17:11:40+02:00 List-Id: Le Fri, 10 May 2013 10:12:22 +0200, Yannick Duch=C3=AAne (Hibou57) = a =C3=A9crit: > Actually, and except with discriminated records and pre/post condition= = > (which are not statically checked), the only static capability of type= s, = > is to enumerate a simple list of values and list operations applicable= = > to that list of values. That's indeed too limited except for trivial = > cases. I was wrong, forgetting an important one: Ada types can be described by = = their origins too. I mean the thing you get when you tell a type has onl= y = a private full definition and have functions returning an instance of th= at = type. These functions are the origin of instances, and more or less = express what instances are, as the assertions about what's returned by t= he = function, finally becomes assertions of the type. These functions are = finally part of the type definition too. That's informal specifications,= = while that still opens the door to better. That's a consequence of type being matched by name and not by structure = = (that's a reason why type matched by name is better, more expressive). As a summary of what's available to describe a type: * list of contiguous values (unfortunately, holes are not allowed, = except using static predicates); * list of applicable operations (unfortunately, very poorly specified= : = only signature); * invariant predicate (unfortunately, not statically checked, except = = with static predicate); * functions generating the initial values (for private types only, no= t = trustable otherwise). (did I still forget one?) Not enough, while finally not that bad. -- = =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