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=0.6 required=5.0 tests=BAYES_20,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c7f5c70275787af8 X-Google-Attributes: gid103376,public From: aratel@total.net (Andre Ratel) Subject: Re: Ada vs Delphi? Date: 1999/08/11 Message-ID: <37b129ae.43419124@news.total.net>#1/1 X-Deja-AN: 511369911 References: <37ab421a.5414989@news.total.net> <37ab8bd1.0@news.pacifier.com> <37ae1fc8.653954@news.clara.net> <7olfni$jsu$1@nnrp1.deja.com> X-Complaints-To: abuse@total.net X-Trace: news.total.net 934357360 216.210.29.75 (Wed, 11 Aug 1999 03:42:40 EDT) Organization: TotalNet Inc. NNTP-Posting-Date: Wed, 11 Aug 1999 03:42:40 EDT Newsgroups: comp.lang.ada Date: 1999-08-11T00:00:00+00:00 List-Id: -= Mixing types =------------------------- On Mon, 09 Aug 1999 02:51:34 GMT, Robert Dewar wrote: > What you can do in Pascal, which you cannot do in >Ada, is to freely mix "different" integer types. I put the >"different" in quotes since really there is only one integer >type in Pascal (at least by Ada standards). I'm not sure I fully understand. Let's say n1 and n2 are known to be non-negative integers (called cardinals in Delphi) but their difference might be positive or negative. In Delphi, I would then declare these variables as type n1, n2: cardinal; N21, N12: integer; and I could have something like begin n1:= 0; n2:= 8; N21:= n2 - n1; Writeln(IntToStr(N21)); N12:= n1 - n2; Writeln(IntToStr(N12)); end; This seems OK with me and, with range checking off, would give the right answers (8 and -8). On the other hand, a statement like Writeln(IntToStr(n1 - n2)); would give 4294967288. Now, with the above definitions of variables, a statement like N21:= n2 - n1; would not be valid with Ada? rem: If, in the above program, I add the compiler directive {$RANGECHECK ON} calculating N12 leads to a range check error (although N12 has been declared as an integer). -= Absence of standards =-------------------------- >Pascal is really not "truely" well defined. FOr one thing, it >is a mess that the ANSI standards and ISO standards are >different (I assume this is still the case, if this abominable >state of affairs has been fixed, let me know). I often read this as one of the main reasons for the demise of Pascal and its replacement by C. (As for the other reason, I would suggest that C simply rides on the popularity of Unix.) >Second, almost no Pascal compilers implement exactly the >standard and nothing more. One of the VERY important aspects >of Ada is that a standard Ada compiler is not permitted any >extensions over what is in the standard, so in practice it is >far easier to write portable Ada programmers, and there is >one source of the standard semantics. This is certainly one major advantage of Ada over Delphi. Andre