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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.130.68 with SMTP id e65mr23295877iod.7.1451157705641; Sat, 26 Dec 2015 11:21:45 -0800 (PST) X-Received: by 10.182.241.195 with SMTP id wk3mr396227obc.8.1451157705606; Sat, 26 Dec 2015 11:21:45 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!feeder.erje.net!1.eu.feeder.erje.net!news.ripco.com!news.glorb.com!mv3no21494833igc.0!news-out.google.com!f6ni34497igq.0!nntp.google.com!mv3no15492828igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 26 Dec 2015 11:21:45 -0800 (PST) In-Reply-To: <28691853-48fd-4d68-b28b-3ecbaf7a1bc0@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=24.6.21.101; posting-account=Qh2kiQoAAADpCLlhT_KTYoGO8dU3n4I6 NNTP-Posting-Host: 24.6.21.101 References: <28691853-48fd-4d68-b28b-3ecbaf7a1bc0@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Here is why C and C++ are bad... From: Anh Vo Injection-Date: Sat, 26 Dec 2015 19:21:45 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:28883 Date: 2015-12-26T11:21:45-08:00 List-Id: On Saturday, December 26, 2015 at 4:47:23 AM UTC-8, Serge Robyns wrote: > On Friday, 25 December 2015 22:54:10 UTC+1, Ramine wrote: >=20 > with Ada.Text_IO; use Ada.Text_IO; >=20 > procedure test is > u : Natural :=3D 1234; > i : Integer :=3D -1233; > result1 : Natural; >=20 > begin > result1 :=3D u + i; > Put_Line ("result: " & Natural'Image (result1)); > end test; and your point is? This compiles since Natural is a subtype of Integer. Oth= erwise, it will be rejected by the compiler if u : New_Natural :=3D 1234; w= here type New_Natural is new Integer range 0 .. Integer'Last; Thus, this ex= ample did not demonstrate the mixing of two separate types.