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!news3.google.com!out03a.usenetserver.com!news.usenetserver.com!in01.usenetserver.com!news.usenetserver.com!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!bandi.nntp.kabelfoon.nl!npeer.de.kpn-eurorings.net!npeer0.kpn.DE!newsfeed.arcor.de!newsspool3.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: <1179991769.376381.252010@m36g2000hse.googlegroups.com> <12h6mi42jcha0.7f9vfsnihjwr$.dlg@40tude.net> <1180011507.159515.46920@o5g2000hsb.googlegroups.com> <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> Date: Wed, 30 May 2007 15:56:32 +0200 Message-ID: <1ljmbgesxien.syhurcvjdcd2$.dlg@40tude.net> NNTP-Posting-Date: 30 May 2007 15:54:15 CEST NNTP-Posting-Host: b21cf1bb.newsspool3.arcor-online.net X-Trace: DXC=J?42PUSPg`c_0Po7BmQ3]lMcF=Q^Z^V3h4Fo<]lROoRaFl8W>\BH3YbE[AY5fQJQnjDNcfSJ;bb[eFCTGGVUmh?dLK[5LiR>kgblQ3NoVY=`8g X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:15979 Date: 2007-05-30T15:54:15+02:00 List-Id: On 30 May 2007 05:54:02 -0700, Maciej Sobczak wrote: > On 30 Maj, 10:43, "Dmitry A. Kazakov" > wrote: > >> Referential semantics is an implementation detail. > > No, it is not. It gives you explicitly the possibility to "reseat" the > referer as well as sharing semantics. These are not details. No shared semantics in this context. The values identify themselves, otherwise the type shall be limited and no assignment would come in question. > Even with strings, you might want to share the strategy for character > encoding. I don't. String has a value, only this counts. You claim that these values *semantically* cannot be assigned. This is obviously wrong. Semantically a string is a chain of code positions. I can assign them, I want do it. But even if that were semantically wrong, even so, why using pointer should magically change anything here? What was wrong without pointers stay wrong with them. Reverse is untrue. >> But it would be in vain, because assigning class-wide >> references in this context is semantically equivalent to assigning the >> targets. > > Which I say should be banned, because the targets are not statically > known. Why should I *statically* know string bounds and encoding? Any reason? >> When you create a void * you have to somehow >> specify the hidden parameter of the case-statement: >> >> void * X = Create_UTF8 ("foo"); >> >> With types you just specify the type of the object instead: >> >> X : UTF8_String := "foo"; > > Which - again - is not an assignment. > Just a reminder - we are talking about: > > X := Y; Remember, you have just allowed this, both are void *. You will need to dereference the pointer. At that point you will face your void. (:-)) It has to be a class to accommodate values of different representation. There is no escape. >> Your point was that I shall not do it publicly. But, may I dispatch >> privately? > > Privately you can dispatch to your internal strategies to get > character conversions, buffers, etc. How? To dispatch you need a class, which you have just scraped. >>>> Static polymorphism does not allow mixing types. >> >>> ? >> >> Instances from a statically polymorphic class of types are unrelated types. >> You cannot have any polymorphic object from that class, only specific >> objects. For the same reason you cannot have any class-wide operation from >> that class. > > So? Unrelated types cannot be mixed in a strongly typed language. >>>> Further you cannot design >>>> a library for formatting strings which would not be generic itself. >> >>> 1. So? >> >> Write an editor for such strings, store a string, send it over the network, >> do anything after uninstalling the compiler ... > > Still don't see the problem. How to instantiate a template when the type is unknown? >> What are you going to do if the endianess >> of Wide x n Character does not fit your machine? > > And why should I bother with endianness here? Because of the number of possible permutations of the bytes in Wide x n Character. I presume that Character, Wide x n Character are pointers to ... mmm, don't know what. Anyway, have fun! >> Whatever pattern you use, you will have to deal with this number of >> cases. > > Or I just delegate to locale and conversion library that is part of my > operating system. And to whom delegates the conversion library? (:-)) > On my system I can have LOTS of different locales: > > $ locale -a | wc -l > 502 > > Do you really expect me to have 502 classes in my program just for > strings? Yes, if you wanted to prevent locales from mixing, if you wanted to deal with text orientation in different languages, if you wanted locale-dependent sorting etc. There must be a deep elaborated hierarchy I suppose. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de