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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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 X-Received: by 10.180.94.41 with SMTP id cz9mr1252594wib.1.1363282165651; Thu, 14 Mar 2013 10:29:25 -0700 (PDT) X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 78.192.65.63 Path: g1ni65765wig.0!nntp.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!nntpfeed.proxad.net!news.muarf.org!news.ecp.fr!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Is this expected behavior or not Date: Thu, 14 Mar 2013 18:29:18 +0100 Organization: cbb software GmbH Message-ID: <1wv3p3nrtejfk$.bwebhg9agt0l.dlg@40tude.net> 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> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: pQ928Up2OZ3uIq9RKW9GMg.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Date: 2013-03-14T18:29:18+01:00 List-Id: On Thu, 14 Mar 2013 17:21:23 +0100, J-P. Rosen wrote: > Le 14/03/2013 15:26, Dmitry A. Kazakov a �crit : >>> Because ADTs are constructs of human mapping from a model space to the >>> > space of language constructs. In this case the latter is defined in Ada >>> > terms. >> That does not answer the question. ADT is a set of values and operations. >> Please, show how Positive is different from that. >> > The set of values is not defined by Positive, it is defined by Integer. Still, Positive has values, and operations. > Positive is a name to designate a subset of these values. And Integer is a name to designate a subset of Z. And Z is a subset of R or Q. And R is a subset of C. Why does it matter? >>> There are two problems instead: >>> >>> 1) to think that a subtype creates a type >> >> It certainly does. Positive /= Integer and the inequality here is in Ada >> terms. >> > Ada allows assignment only if both sides are of the same type. You can > assign Integer to Positive, and conversely. Therefore, Positive and > Integer are the same type. You forgot other possibilities: 1. The premise is wrong. It is, Ada indeed allows assignment of different types. Example: type T is tagged null record; X : T'Class := T'(null record); I hope you will not claim that T'Class and T are the same type. 2. Assignment is a primitive operation of the corresponding class of related types which effectively permits profiles like: procedure ":=" (Left : in out Integer; Right : Integer); procedure ":=" (Left : in out Positive; Right : Integer); procedure ":=" (Left : in out Integer; Right : Positive); procedure ":=" (Left : in out Positive; Right : Positive); Observe that in Ada these bodies are different. E.g. the second may raise Constraint_Error. I didn't say that Positive is unrelated to Integer type. It is a subtype of. Yet it is a distinct type with a set of values and a set of operations. In order to be "sub-something" you must be "something" first. > And please, we are talking about Ada here, not KOVOA (Kasakov's Own View > of Ada). Yes, it is my view of Ada. You have yours. What is wrong with that? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de