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: Sun, 7 Apr 2013 20:10:09 +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> <1e5t211h9n19a.ayvvr4wdm89y$.dlg@40tude.net> NNTP-Posting-Host: medsec1.medien.uni-weimar.de Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-147471225-1365358116=:2487" X-Trace: tigger.scc.uni-weimar.de 1365358284 16122 141.54.178.228 (7 Apr 2013 18:11:24 GMT) X-Complaints-To: news@tigger.scc.uni-weimar.de NNTP-Posting-Date: Sun, 7 Apr 2013 18:11:24 +0000 (UTC) X-X-Sender: lucks@debian In-Reply-To: <1e5t211h9n19a.ayvvr4wdm89y$.dlg@40tude.net> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) Content-ID: Xref: news.eternal-september.org comp.lang.ada:14910 Date: 2013-04-07T20:10:09+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-147471225-1365358116=:2487 Content-Type: TEXT/PLAIN; CHARSET=ISO-8859-15; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Content-ID: On Sat, 6 Apr 2013, Dmitry A. Kazakov wrote: >> The same for conversions between Integer and Float. > > Nope. You cannot convert house number to outdoor temperature. So what? Neither can I convert my zip code to my birth year (both=20 Positive) or the outdoor temperature to speed of light. ;-) Ada allows to define types such as, Apples and Oranges, or, say Speed and= =20 Temperature. But this has nothing to do with the underlying mathematical=20 struture of each of these types. Actually, mixing integers and float (or integers and fixed-point numbers)= =20 is not that uncommon. The maximum speed for a vehicle, say, a train at a=20 certain part of the track, is, most likely, an integer, while the speed=20 the sensors measure isn't an integer. So you have something like the=20 following code: Current_Speed : Speed; Max_Speed : Integer_Speed; Safety_Margin : constant Speed :=3D ... ... if Current_Speed > Speed(Max_Speed) then Display_Warning(Speed_Warning); Play_Alarm_Sound; if Current_Speed < (Speed(Max_Speed) + Safety_Margin) then Perform_Emergency_Break; end_if: end_if; Here, you need the to convert Max_Speed to Speed, even though the two=20 types Speed and Integer_Speed have the same semantic. I don't think we'll agree on this issue, but I fail to see any significant= =20 distinction between the class of arithmetic types and string types. ------ I love the taste of Cryptanalysis in the morning! ------ --Stefan.Lucks (at) uni-weimar.de, Bauhaus-Universit=E4t Weimar, Germany-- --8323329-147471225-1365358116=:2487--