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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,73cb216d191f0fef X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.86.34 with SMTP id m2mr1105689wiz.5.1363382234103; Fri, 15 Mar 2013 14:17:14 -0700 (PDT) MIME-Version: 1.0 From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Is this expected behavior or not Date: Fri, 15 Mar 2013 16:17:11 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <8klywqh2pf$.1f949flc1xeia.dlg@40tude.net> <513f6e2f$0$6572$9b4e6d93@newsspool3.arcor-online.net> <513faaf7$0$6626$9b4e6d93@newsspool2.arcor-online.net> <51408e81$0$6577$9b4e6d93@newsspool3.arcor-online.net> <1xqmd3386hvns.1og1uql2cgnuf$.dlg@40tude.net> <5140b812$0$6575$9b4e6d93@newsspool3.arcor-online.net> <5140f1ad$0$6634$9b4e6d93@newsspool2.arcor-online.net> <7jct0noryc1v.1rnj5kkzx6m35.dlg@40tude.net> <5141c499$0$6642$9b4e6d93@newsspool2.arcor-online.net> <18r2kop6fyozu.tctrjnghfxqs.dlg@40tude.net> <1wv3p3nrtejfk$.bwebhg9agt0l.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1363382233 6662 69.95.181.76 (15 Mar 2013 21:17:13 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 15 Mar 2013 21:17:13 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Path: g1ni68019wig.0!nntp.google.com!proxad.net!feeder1-2.proxad.net!feed.ac-versailles.fr!news.ecp.fr!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail Date: 2013-03-15T16:17:11-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:ewe0v3ck1xdo$.e8rtuof27ke6$.dlg@40tude.net... > On Thu, 14 Mar 2013 17:12:28 -0500, Randy Brukardt wrote: > >> "Dmitry A. Kazakov" wrote in message >> news:1wv3p3nrtejfk$.bwebhg9agt0l.dlg@40tude.net... >>> On Thu, 14 Mar 2013 17:21:23 +0100, J-P. Rosen wrote: >> ... >>>> The set of values is not defined by Positive, it is defined by Integer. >>> >>> Still, Positive has values, and operations. >> >> Yes, and they're exactly the same set as Integer has. > > Even so, having those makes it an ADT. For the sake of argument consider > > subtype Integer_X is Integer; > > Both are ADTs. > > BTW, a renaming would be the thing you are talking about. But Ada does not > have type renaming. People [mis]using subtypes for the purpose of renaming > must be prepared to nasty surprises. > >> There are some differences in *dynamic* behavior, but that has nothing to >> do >> with the available values and operations. (The text you quoted from the >> RM >> about values "belonging" to a subtype is defining dynamic behavior.) I >> recall some Dmitry guy telling us that dynamic behavior is different from >> static behavior, and even claiming that dynamic behavior cannot >> constitute a >> contract. So it if is not a *contract*, how come it matters for a *type* >> (which is an integral part of describing a contract)? > > I don't understand the point you are making. You cannot derive contract > from behavior, simply because it is converse: contract is imposed to > restrain possible behaviors. > > You might claim that implied contracts of Integer and Positive are exactly > same. I doubt that many would agree with that. I certainly wouldn't, because *I* consider the dynamic behavior to be part of the contract. But, clearly, you don't (and you've indicated that above again. So yes, given your world view, the contracts of Integer and Positive are exactly the same. That's clear, because they're interchangable in terms of legality and resolution (anything having to do with compile-time checking). The quote above says that you disagree with yourself. :-) "I doubt that many would agree with that." That's certainly true, but that's because few would agree with you on the notion that the contract does not include the dynamic behavior. In any case, either *you* have to agree with this premise (and thus all of your arguments on type vs. subtypes are nonsense), or you are no longer agreeing with your previous statements about contracts (which I for one would welcome, but it's seems pretty unlikely of a change). I'm sure you'll try to reconcile this by completely ignoring the rules of Ada and redefining all of the terms involved. Enjoy. Randy.