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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3d6ef988ec3a5ef7 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: renaming Interfaces.Java.Ada_To_Java_String to the + operator Date: 1998/01/15 Message-ID: #1/1 X-Deja-AN: 316456923 References: <01bd1e34$1632c2c0$24326489@Westley-PC.calspan.com> <01bd1ebc$3bb2cb20$20f382c1@xhv46.dial.pipex.com> <01bd1fc9$99302a00$24326489@Westley-PC.calspan.com> <01bd21ff$7f85e3a0$95fc82c1@xhv46.dial.pipex.com> X-Complaints-To: usenet@news.nyu.edu X-Trace: news.nyu.edu 884923758 12834 (None) 128.122.140.58 Organization: New York University Newsgroups: comp.lang.ada Date: 1998-01-15T00:00:00+00:00 List-Id: Nick says <> Well anyone can assert anything! The point is that we cannot tell from your example which is clearer. The issue is whether it is important at the appropriate level of abstraction to emphasize that there are two types involved here. If yes, then the top line is preferable, if no, then the bottom line is preferable, since the "To_Java_String" is irrelevant noise. Note that when you say A := B; you are quite happy with this even though A and B have different subtypes. Now if in fact A is of subtype Integer range 1 .. 10 and B is of subtype Integer, and a major function of the assignment statement is the range check, then it would not come amiss to say A := Restricted_Integer_Range_Type (B); but normally this is NOT a major semantic component of what is going on (even though the check might be there), and we are very happy to not be forced to write the type name for this kind of subtype conversion check. Now in the case where two separate types are involved, the conversion between them may or may not be significant. I can easily imagine a situation where you are using two packages, each of which instantiates a copy of bounded string for 100 character strings. You are stuck with these two types because that's the way the packages came, but as far as you are concerned it would have been better if they had been the same type, and the type conversions are entirely artifacts and have zero semantic significance. In such a case the + is appropriate (and in fact a bit too noisy, since implicit conversion would be fine in this case, but + is not too bad as an approximation of nothing :-)