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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e1bb9627c57b7d5b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-08 12:16:18 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsmi-us.news.garr.it!NewsITBone-GARR!news.mailgate.org!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "Alexandre E. Kopilovitch" Newsgroups: comp.lang.ada Subject: Re: U : Unbounded_String := "bla bla bla"; (was: Is the Writing...) Date: Wed, 8 Oct 2003 23:12:35 +0400 (MSD) Organization: Cuivre, Argent, Or Message-ID: References: <86u4ov4ojmuugvp2p4qsg725ah45p01c2h@4ax.com> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: melchior.cuivre.fr.eu.org 1065640423 62426 80.67.180.195 (8 Oct 2003 19:13:43 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Wed, 8 Oct 2003 19:13:43 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: In-Reply-To: <86u4ov4ojmuugvp2p4qsg725ah45p01c2h@4ax.com>; from "Dmitry A. Kazakov" at Tue, 07 Oct 2003 10:51:31 +0200 X-Mailer: Mail/@ [v2.44 MSDOS] X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Gateway to the comp.lang.ada Usenet newsgroup List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:489 Date: 2003-10-08T23:12:35+04:00 Dmitry A. Kazakov wrote: > > type Y is private envelope of X; > > > [...] > > Looks similar to my proposal for defining subtypes. I think yes, there is much in common, although there is also a difference: your proposal is significantly broader; it is certainly heavier as it pertains to possible consequences, and I have no immediate opinion whether it will be easier to find sound applications for that your proposal than for mine, more narrow one. > Why to call "envelope" something which is a subtype? (:-)) "subtype" in Ada implies a possibility of some kind of restriction imposed on the base type, while the word "envelope" implies some kind of extension (of functionality or applicability). You see, for a language terms I strongly prefer application/user view to a compilation theory's view, even for advanced entities/constructions. > It should be something like: > > type Y is private subtype X; > > Note that for the sake of genericity one need more than two > conversions. There should be four: > > X_From_Y, X_To_Y - this pair is used when an Y gets substituted for X, > i.e. when Y *inherits* a subprogram from X. One of these conversions > might be absent. Then Y becomes an in-subtype or an out-subtype of X: > > type Y is private in subtype X; > -- Only in-subroutines are inherited. So only X_From_Y has to be > -- defined > > Y_From_X, Y_To_X - this pair is used when X gets substituted for Y, > i.e. when Y exports something to X. This is a way to create > supertypes. > > type Y is private in out supertype X: Well, it seems that your proposal uses basic diagrams while mine is restricted to isomorphic representations. > If all four conversions are present both types become fully > interchangeable, which is actually required in case String vs. > Unbounded_String. I don't see why two conversions (which provide isomorhic representation) aren't enough for String vs. Unbounded_String... if we have no intention to extend current functionality (except of making implicit conversions possible). Alexander Kopilovitch aek@vib.usr.pu.ru Saint-Petersburg Russia