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,7b5b3c67aa2a73fe X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "(see below)" Newsgroups: comp.lang.ada Subject: Re: Easy question about Character manipulation Date: Tue, 30 Jan 2007 02:09:22 +0000 Message-ID: References: <1170100860.762334.13830@l53g2000cwa.googlegroups.com> <1d5n0ksoz75yy.3t2hhxjr35fq$.dlg@40tude.net> <1170106218.6329.63.camel@localhost> <1170121405.6329.89.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: individual.net 06tQ19kJl1XMhC60w6tNEg5wGmUBNFkHhONQIMGmA2ZCIcb+Iz User-Agent: Microsoft-Entourage/11.3.3.061214 Thread-Topic: Easy question about Character manipulation Thread-Index: AcdEE6gt5o8C0bAGEduzcQARJIjQTg== Xref: g2news2.google.com comp.lang.ada:8698 Date: 2007-01-30T02:09:22+00:00 List-Id: On 30/1/07 01:43, in article 1170121405.6329.89.camel@localhost, "Georg Bauhaus" wrote: >> On the contrary, this *exactly* like (ISO Standard) Pascal. > > I don't think so, if a Pascal compiler is supposed > to determine "the same type" (exact same type) by looking > at the definition, not the name. Otherwise two compilers > claiming to support ISO Pascal are broken: Trust me, I was one of the team that wrote the standard. 8-) > program p; > > type > T = 1 .. 3; > S = 1 .. 3; > var > x : T; > y : S; > begin > x := y; { fine in Pascal } > end. > > This program seems to be Standard Pascal, and compiles. This does not imply that S and T are considered to be the same type. (See below.) > The corresponding Ada program will not compile: > > procedure p is > type T is range 1 .. 3; > type S is range 1 .. 3; > x : T; > y : S > begin > x := y; -- not the same type, compilation error > end; This is not a matter of type equivalence, it is a matter of automatic type conversion on assignment (assignment compatibility), and that IS unlike Ada, of course. It would work just as well in Pascal if S were 1..3 and T were 2..4, and these are obviously not the same type. (There are further classes of compatibility in other Pascal contexts.) -- Bill Findlay chez blueyonder.co.uk