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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2ff5c149712ec0eb X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!k79g2000hse.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Ada Interfaces and the Liskov Substitution Principle Date: Wed, 06 Jun 2007 08:11:07 -0700 Organization: http://groups.google.com Message-ID: <1181142667.440645.261600@k79g2000hse.googlegroups.com> References: <1j91i6rk18kqd.4zjp36eyvps3.dlg@40tude.net> <1180619211.595952.116690@k79g2000hse.googlegroups.com> <1180704750.516171.126220@h2g2000hsg.googlegroups.com> <1r1lyrsyvr52v$.vx1t785sxb9u.dlg@40tude.net> <1180729864.936057.258970@p47g2000hsd.googlegroups.com> <1180802978.626766.128330@h2g2000hsg.googlegroups.com> <2vwm0plnu7gn.172jlansis6fm.dlg@40tude.net> <1180908240.364236.145720@g4g2000hsf.googlegroups.com> <14qx1ctt7r0kf$.on8dfqklv4jk$.dlg@40tude.net> <1180976568.313756.322280@q66g2000hsg.googlegroups.com> <1lzp9p6pnkazp$.17gvbzz8nm6mo$.dlg@40tude.net> <1181081549.890902.141600@w5g2000hsg.googlegroups.com> <12ocy5k4zedug.pdeokn8ijlgx.dlg@40tude.net> <1181141207.588414.121150@p47g2000hsd.googlegroups.com> NNTP-Posting-Host: 137.138.37.241 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1181142667 31399 127.0.0.1 (6 Jun 2007 15:11:07 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 6 Jun 2007 15:11:07 +0000 (UTC) In-Reply-To: <1181141207.588414.121150@p47g2000hsd.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.12) Gecko/20070601 Red Hat/1.5.0.12-0.1.slc3 Firefox/1.5.0.12,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: k79g2000hse.googlegroups.com; posting-host=137.138.37.241; posting-account=Ch8E9Q0AAAA7lJxCsphg7hBNIsMsP4AE Xref: g2news1.google.com comp.lang.ada:16080 Date: 2007-06-06T08:11:07-07:00 List-Id: On 6 Cze, 16:46, Maciej Sobczak wrote: > > My congratulations! But that's not all: > > > procedure Swap (X, Y : in out Integer); > > > declare > > X : Positive := 1; > > Y : Integer := -1; > > begin > > Swap (X, Y); > > -- oops > > Yes, let's ban it too. Inout parameters should match exactly in terms > of constraints (see below). Here I was confused by something different. This subject is unrelated to assignment. If we want class-wide types to behave in all aspects like unconstrained types (or like constrained types that can have additional constraints added), then indeed this example shows serious problem with my reasoning. I will come back to this in a while. -- Maciej Sobczak http://www.msobczak.com/