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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!mx05.eternal-september.org!feeder.eternal-september.org!newsfeed.fsmpi.rwth-aachen.de!news-1.dfn.de!news.dfn.de!news.uni-weimar.de!medsec1.medien.uni-weimar.de!lucks From: Stefan.Lucks@uni-weimar.de Newsgroups: comp.lang.ada Subject: Re: Is this expected behavior or not Date: Fri, 5 Apr 2013 22:23:13 +0200 Organization: Bauhaus-Universitaet Weimar Message-ID: References: <1gnmajx2fdjju.1bo28xwmzt1nr.dlg@40tude.net> <3gv2jwc95otm.pl2aahsh9ox8.dlg@40tude.net> <1gkxiwepaxvtt$.u3ly33rbwthf.dlg@40tude.net> <1fmcdkj58brky.bjedt0pr39cd$.dlg@40tude.net> <1bj564vat3q1j$.1s4d00rlzx4ux$.dlg@40tude.net> <1cfhriq4xpg9s$.3yl33z705wpn$.dlg@40tude.net> <16wai67izvmu5.13yz864sx1cqd$.dlg@40tude.net> <1xbow8ojtmac9.1sfor8ytiplgx.dlg@40tude.net> NNTP-Posting-Host: medsec1.medien.uni-weimar.de Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-463205224-1365193394=:31746" X-Trace: tigger.scc.uni-weimar.de 1365193464 6354 141.54.178.228 (5 Apr 2013 20:24:24 GMT) X-Complaints-To: news@tigger.scc.uni-weimar.de NNTP-Posting-Date: Fri, 5 Apr 2013 20:24:24 +0000 (UTC) X-X-Sender: lucks@debian In-Reply-To: <1xbow8ojtmac9.1sfor8ytiplgx.dlg@40tude.net> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) Xref: news.eternal-september.org comp.lang.ada:14881 Date: 2013-04-05T22:23:13+02:00 List-Id: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-463205224-1365193394=:31746 Content-Type: TEXT/PLAIN; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Fri, 5 Apr 2013, Dmitry A. Kazakov wrote: > On Fri, 5 Apr 2013 21:02:43 +0200, Stefan.Lucks@uni-weimar.de wrote: > No, I insist that it is up to the programmer to decide whether two types = to > become compatible (relative) or not. Character and Wide_Character are > evidently relative. Integer and Float are "evidently relative". > I disagree. They wanted to prevent the mess of PL/1 where *arbitrary* > conversions were applied to semantically unrelated types. Types like > Character and Wide_Character are semantically related. Conversion from on= e > to another is perfectly well defined. The same for conversions between Integer and Float. >> Sure, some cases where implicit conversions take place >> exist, but only very few. One example is the conversion of constants of >> type Universal_Something into the right type. > > It makes sense in all cases where types are related. This is simply the > definition of a type S being a subtype of T <=3D> S is substitutable for = T. And Integer is substitutable for Real. > If representations are different the substitution is done per conversion. > Not a rocket science, really. Clearly, the designers of Ada where reluctant to define an implicit=20 conversion from Integer to Float. I am glad about that -- it frequently=20 helps me catching errors. Similarly for the distinction between different= =20 String types. Sure, explicit conversions, are sometimes annoying, and so is the mess=20 with constants. That is the same for string types as for arithmetic ones. E.g. I frequently get caught by the compiler writing, say, "2" where I=20 would have to write "2.0" for a constant Float. > And it is all up to the programmer to tell the compiler that S must be > considered a subtype of T, whatever representation both might have is not > language's business. Arithmetic types and String types are in the same boat here. There is no=20 logical reason to allow implicit conversions for one class and not for the= =20 other one. ------ I love the taste of Cryptanalysis in the morning! ------ --Stefan.Lucks (at) uni-weimar.de, Bauhaus-Universit=E4t Weimar, Germany-- --8323329-463205224-1365193394=:31746--