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: a07f3367d7,73cb216d191f0fef X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.86.34 with SMTP id m2mr1241971wiz.5.1364344053598; Tue, 26 Mar 2013 17:27:33 -0700 (PDT) MIME-Version: 1.0 Path: p18ni19756wiv.0!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.138.MISMATCH!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsgate.cuhk.edu.hk!goblin2!goblin.stu.neva.ru!newsfeed.x-privat.org!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Is this expected behavior or not Date: Tue, 19 Mar 2013 16:37:30 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <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 1363729055 16968 69.95.181.76 (19 Mar 2013 21:37:35 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 19 Mar 2013 21:37:35 +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 Date: 2013-03-19T16:37:30-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:vawvqtrqgamw$.1gsl8m14dvk4i.dlg@40tude.net... > On Mon, 18 Mar 2013 17:36:31 -0500, Randy Brukardt wrote: > >> "Dmitry A. Kazakov" wrote in message >> news:hiybjkhz3p5d.1x6dxfr1ptgcg.dlg@40tude.net... > >>> But I don't see where I disagree with myself. Contract /= type. You can >>> have same contract and different types. What about: >>> >>> type Same is new Integer; >> >> This definitely has a different contract, as it is not compatible with >> Integer's contract. Yes, it has the same set of values and operations >> with >> the same name, profile, and bodies, but it's still a different contract >> because the types involved are an intergral part of the contract. > > See, you just defined a contract in terms of types while using contracts > to > define type as same/different/non-existent. You cannot have it in both > ways. If you can't handle recursive definitions, you'll never get very far in programming language design. The only requirement is that each step gets simpler, which certainly is the case here. >>> You also can have different contracts put on the same type in different >>> contexts. You can have contracts on something that does not involve >>> types >>> at all. Anyway, I fail to see how contracts are relevant here. >> >> Because types are an important part of a contract (that is, in Ada terms, >> the profile). > > *if* you want to contract a type, *then* that cannot be a part of. A type *has* a contract. A contract is made up (in part) of types. No problem. ... ... >> I agree with Georg; Positive is not a type; it *has* a type. Neither is >> Integer a type; it *has* a type. > > Since there is an equivalence between Positive and the type is "has," No, there is not any equivalence. "Type" is just one property of "Positive", and it might have the same value as that of some other subtype (like "Natural"). > Positive as a name unambiguously refers to that type, i.e. "Positive" is > the name of the type. Unless you have other legal name for it. But you > don't in Ada. You have absolutely no language means whatsoever to > distinguish Positive and the type of. So, what merits has this distinction > if it cannot be observed? "The type of Positive" unambigiously identifies that property for "Positive". There is not "name" (that is, identifier) associated with that property. >> (All types in Ada are anonymous.) > > Great, then let them be, where there belong to, in the celestial spheres, > and let us call type something that indeed exists in the language and has > a > name. Well, if you insist on naming the unnameable, you'll never reach any useful understanding. If you absolutely have to have a name, call it "the type of Positive" or "Positive'Base" (not all types have the 'Base attribute, or you could use that as the name). And Positive'Base = Integer'Base = Natural'Base. >> Types are only about static semantics >> (that is, compile-time behavior). Run-time semantics aren't involved. > > Run-time semantics is what makes program working or not working. Types are > all about run-time semantics nothing else counts. Then we really have nothing to talk about. > Type checks is a way to prove something about [run-time] semantics at > compile time. Types neither ensure nor required for a program to behave > correctly. They are a tool to ease reaching that goal. > >> Run-time semantics get added on top of that, but that has no effect on >> the >> legality of a program, so it is completely orthogonal to the >> type/profile. > > Legality is irrelevant as we consider only legal Ada programs. There exist > legal Ada programs which change their run-time behavior when 'Positive' is > replaced by 'Integer' and reverse. "We consider only legal Ada programs" -- please speak for yourself. What is in or not in that set of legal Ada programs is a very important part of Ada's design (and any language design). I'm not particularly interested in the run-time semantics of scalar types, because it is pretty much that of the hardware and no amount of language design is going to change that. The only thing we can tweak is what is legal and illegal. It's pretty obvious that you have no interest in useful discourse on this topic (which is really too bad, because you have interesting ideas that could help out Ada in the long run), so I'm going to do my best to ignore this thread in the future. Randy.