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: 103376,66fae8c862b81b17 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Received: by 10.180.97.162 with SMTP id eb2mr5106821wib.0.1352322017826; Wed, 07 Nov 2012 13:00:17 -0800 (PST) Path: ha8ni163225wib.1!nntp.google.com!goblin3!goblin1!goblin2!goblin.stu.neva.ru!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: Copy vector in Ada Date: Wed, 07 Nov 2012 22:00:14 +0100 Organization: Ada @ Home Message-ID: References: <1aWdnbcg_8-BzAzNnZ2dnUVZ_j6dnZ2d@giganews.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> NNTP-Posting-Host: aWaWeUaBdaj2Zzc04J1v5A.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.02 (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: 2012-11-07T22:00:14+01:00 List-Id: Le Wed, 07 Nov 2012 21:04:27 +0100, Dmitry A. Kazakov = a =C3=A9crit: > 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: Seems every one agree with it. > 1. specialization: > > 1.1 Ada's subtypes > 1.2 Ada's in-mode arguments > 1.3 Ada's constants All are subtypes, not just the first alone. > 1.4 Ada's discriminated types Specifies possible subtypes. That's just user defined subtypes (unlike t= he = aboves, which are Ada predefined). > 1.5 Ada's specific types as related to the class-wide counterparts, e.= g. = > T is a specialization of T'Class. Both belong to a different category, can't be compared. Why do you say =E2= =80=9CT = is a specialization of T'Class=E2=80=9D? Anything in T'Class is expected= to be = predictable to behave like T, so why is T a specialization compared to = T'Class? > 2. extension =3D Cartesian product, Ada's tagged types I don't see, and on the contrary, feel extensions is even where it appli= es = the best. >> 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 w= hy, > for example, extensible enumerations (which would be a generalization)= = > pose > such a big problem. What do you call generalization here? Something which would be like givi= ng = an ancestor to a type which don't have one? (not sure to understand) > It is important to remember that any non-trivial modification of a typ= e > always breaks something. There is no rule expressed in terms of type = > values > which could ensure LSP. Bijection of domain sets the only mapping whic= h > would unconditionally satisfy the requirement of weakening pre- and > strengthening post-conditions of all operations. Yes, that's why using pre/post requires to be careful, to not break = anything or too much. Especially with preconditions, which may be the mo= st = easy to forget about, due to the disjunction. -- = =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