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-Thread: 103376,1cd9f7e5a0d12003 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.223.40 with SMTP id qr8mr26303852pbc.0.1337677420791; Tue, 22 May 2012 02:03:40 -0700 (PDT) Path: pr3ni26099pbb.0!nntp.google.com!news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Martin Newsgroups: comp.lang.ada Subject: Re: condition true or false? -> (-1 < sizeof("test")) Date: Tue, 22 May 2012 01:00:56 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 20.133.0.8 Mime-Version: 1.0 X-Trace: posting.google.com 1337677419 23187 127.0.0.1 (22 May 2012 09:03:39 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 22 May 2012 09:03:39 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=20.133.0.8; posting-account=g4n69woAAACHKbpceNrvOhHWViIbdQ9G User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-05-22T01:00:56-07:00 List-Id: On Tuesday, May 22, 2012 7:11:54 AM UTC+1, Nomen Nescio wrote: > glen herrmannsfeldt wrote: > [snip] > > I'm not an expert on this but Ada is very strongly (statically) typed. > There > are only two integer types in Ada to start with, signed integer and modular > integer. This bit isn't right. > The compiler will flag an error if you try to compare variables of > those two types or indeed variables of any differing types. You can define > subtypes of existing types and completely new types and Ada insures you > can't make mistakes by mixing apples and oranges. While this is a bit > confining at times (when you know it's ok to do so) it does preclude the > possibility of something like what Bartc wrote from ever happening. > If you > know the conversion is ok there are ways (usually by providing an unchecked > conversion function) to assign or compare across types. And this bit isn't quiet right - unchecked conversions are really a technique of last resort! But apart from that the gist of what you say is - Ada does help prevent silly (and not so silly) mistakes. Ada typing is easily the richest I know of (see http://en.wikibooks.org/wiki/Ada_Programming/Type_System#The_Type_Hierarchy). -- Martin