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,66fae8c862b81b17 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.101.9 with SMTP id fc9mr1889909wib.3.1352318673063; Wed, 07 Nov 2012 12:04:33 -0800 (PST) X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 88.191.116.97 Path: q13ni182695wii.0!nntp.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!nntpfeed.proxad.net!dedibox.gegeweb.org!gegeweb.eu!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Copy vector in Ada Date: Wed, 7 Nov 2012 21:04:27 +0100 Organization: cbb software GmbH Message-ID: References: <1aWdnbcg_8-BzAzNnZ2dnUVZ_j6dnZ2d@giganews.com> <6260a796-83c4-4ce5-88cb-8249846bc035@googlegroups.com> <10y91ckm54l57$.8u8bbq342u1b.dlg@40tude.net> <2164bc1a-a841-46ed-bfef-4ddcae4d64f7@googlegroups.com> <1ccf2169-418c-44b7-9d5a-b684a017fbe7@googlegroups.com> <1r3lpzblxy43h$.zytp8ur1bg27$.dlg@40tude.net> <1k3sjasg1wftm$.1vlq5hm7vukhk.dlg@40tude.net> <1sinhhpvja1gx.1ue7br8bz2slq$.dlg@40tude.net> <5098f58c$0$6558$9b4e6d93@newsspool4.arcor-online.net> <509a4dfb$0$6642$9b4e6d93@newsspool2.arcor-online.net> <509aa312$0$6634$9b4e6d93@newsspool2.arcor-online.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: pSb85Ij4EqcuHDcWtw64BQ.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="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-11-07T21:04:27+01:00 List-Id: On Wed, 07 Nov 2012 19:06:11 +0100, Georg Bauhaus wrote: > Well, a basic principle about derived types was stated, > > "a derived type has to cover a base type, and will probably > do more, but in anyway, not less", which evidently does not hold in two major cases used in Ada: 1. specialization: 1.1 Ada's subtypes 1.2 Ada's in-mode arguments 1.3 Ada's constants 1.4 Ada's discriminated types 1.5 Ada's specific types as related to the class-wide counterparts, e.g. T is a specialization of T'Class. 2. extension = Cartesian product, Ada's tagged types > The commandment can be called a basic principle in the light of > the substitution principle, Generalization, the kind of type deviation you are talking about, does not save LSP. In particular, it breaks in-operations. This is the reason why, for example, extensible enumerations (which would be a generalization) pose such a big problem. It is important to remember that any non-trivial modification of a type always breaks something. There is no rule expressed in terms of type values which could ensure LSP. Bijection of domain sets the only mapping which would unconditionally satisfy the requirement of weakening pre- and strengthening post-conditions of all operations. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de