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,2ff5c149712ec0eb X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!news2.arglkargh.de!news.visyn.net!uucp.gnuu.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Ada Interfaces and the Liskov Substitution Principle Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1180079541.558215.256570@h2g2000hsg.googlegroups.com> <1180124867.710641.176330@k79g2000hse.googlegroups.com> <1k165n4jwxna3$.1mpx49xvcrc0z$.dlg@40tude.net> <1180254636.632499.3340@o5g2000hsb.googlegroups.com> <1p717twnydnre$.1j6izygvqo832.dlg@40tude.net> <1180425803.422075.100090@o5g2000hsb.googlegroups.com> <1180452858.118039.67740@w5g2000hsg.googlegroups.com> <1180510814.812025.251580@u30g2000hsc.googlegroups.com> <1180529642.741098.224230@q66g2000hsg.googlegroups.com> <1ljmbgesxien.syhurcvjdcd2$.dlg@40tude.net> <1180558336.041236.211560@p77g2000hsh.googlegroups.com> <1j91i6rk18kqd.4zjp36eyvps3.dlg@40tude.net> <1180619211.595952.116690@k79g2000hse.googlegroups.com> Date: Fri, 1 Jun 2007 09:29:18 +0200 Message-ID: NNTP-Posting-Date: 01 Jun 2007 09:26:58 CEST NNTP-Posting-Host: 535c3f1e.newsspool4.arcor-online.net X-Trace: DXC=8g\;o3mE@]T\PS5Xo=M[RV4IUKkgRTmdNjUEN=m[ X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:16014 Date: 2007-06-01T09:26:58+02:00 List-Id: On 31 May 2007 06:46:51 -0700, Maciej Sobczak wrote: > On 31 Maj, 10:15, "Dmitry A. Kazakov" > wrote: > >> You cannot make a class of non-limited types limited. > > Why not? Let's just say so or write it in RM. > >> It would be inconsistent. > > Protected objects are limited even if they contain only Integers. > The inconsistencies are there anyway, so why fighting for unrealistic > purity? Container /= what it occasionally contains. The identity of protected object is essential for synchronization mechanism, for obvious reasons. This is why the protected object has identity and consequently its type was made limited. You cannot abstract Integer from a protected object of. >> A specific object is just a constrained instance of a >> class-wide object. > > Nothing prevents it from having additional operations (in the specific > view, not class-wide). Not in the same package, where adding operations after the freezing point is forbidden. The reason is same - inconsistency. You are trying to invent some alternative meaning for class-wide. What for? If you think that the concept of values from types sets is wrong, say why. >> This is the model of what is going on. Whether the >> objects from the class should or not have assignment or any other operation >> depends solely on the problem domain. It is the programmer's choice. > > Exactly, but the language "helps" the programmer to make some choices. > In Ada most of the time the justification for these is "it's safer". > In my opinion it is safer to not have assignments in class-wide types > and I have nothing against the language to remind me. It is safe, when it functions as I described earlier. Again, whatever the compiler does, the code generated shall not render to "raise Constraint_Error" or for that matter "format C: /q". >>>>> Even with strings, you might want to share the strategy for character >>>>> encoding. >> >>>> I don't. String has a value, only this counts. >> >>> According to the above distinction, string is a value type. >> >> As well as the polymorphic string from the class of: >> >> (UTF-8, "abc") := (ASCII, "def"); -- Why is it a problem? > > It assumes too much. I don't understand this. Is it semantically wrong? >>> Internal strategy can be a class. That's a good place for dispatch >>> (note: I use the term "strategy" from the OO design pattern with the >>> same name). >> >> This is what I meant. Let's move to the internals. How the internal class >> can be assigned? Can it? > > You don't need to assign it. It is enough if you can replace it. Care to explain difference? Doesn't assignment replace one value by another? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de