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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1901f265c928a511 X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news1.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Typing in Ada References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Mon, 31 May 2004 17:01:06 GMT NNTP-Posting-Host: 63.184.33.47 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.news.pas.earthlink.net 1086022866 63.184.33.47 (Mon, 31 May 2004 10:01:06 PDT) NNTP-Posting-Date: Mon, 31 May 2004 10:01:06 PDT Xref: controlnews3.google.com comp.lang.ada:957 Date: 2004-05-31T17:01:06+00:00 List-Id: Empit wrote: > From typing point of view, how strong is Ada than C? > > or > > Which is the most strongly typed language. Why not try them and see? procedure Strongly_Typed is type I1 is new Integer; type I2 is new Integer; type I3 is range -100 .. 100; V1 : I1 := 3; V2 : I2 := 4; V3 : I3; begin -- Strongly_Typed V3 := V1 + V2; end Strongly_Typed; C:\Code>gcc -c strongly_typed.adb strongly_typed.adb:10:13: invalid operand types for operator "+" strongly_typed.adb:10:13: left operand has type "I1" defined at line 2 strongly_typed.adb:10:13: right operand has type "I2" defined at line 3 int main () { /* I cannot call this Strongly_Typed */ typedef int I1; typedef int I2; typedef short I3; I1 V1 = 3; I2 V2 = 4; I3 V3; V3 = V1 + V2; return 0; } C:\Code>gcc -c strongly_typed.c [no messages] Which do you think is more strongly typed? -- Jeff Carter "We call your door-opening request a silly thing." Monty Python & the Holy Grail 17