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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9d0b383ee17c13af X-Google-Attributes: gid103376,public From: wf@dcs.gla.ac.uk (Bill Findlay) Subject: Re: One type for all Date: 1999/07/20 Message-ID: #1/1 X-Deja-AN: 503225587 References: <3783E0D2.5D74243@boeing.com> <3786741C.E73F1124@hso.link.com> <7mdobd$fu$1@nnrp1.deja.com> <1999Jul12.193436.1@eisner> <7mqueq$k7e$1@nnrp1.deja.com> <7mttci$edv$1@nnrp1.deja.com> Organization: The University of Glasgow Newsgroups: comp.lang.ada Date: 1999-07-20T00:00:00+00:00 List-Id: In article <7mttci$edv$1@nnrp1.deja.com>, Robert Dewar wrote: > In article , > Keith Thompson wrote: > > ] Two types are said to be _compatible_ if any of the > > following four conditions is true. > > ] > > ] (a) They are the same type. > > ] (b) One is a subrange of the other, or both are subranges of the > > ] same host type. > > ] (c) Both are set types, their base types are compatible, and either > > ] both are packed or neither is packed. > > ] (d) Both are string types with the same number of components. > ... > So thanks, it is indeed the case that Pascal does NOT have > structural type equivalence, which is what I remembered (any > other conclusion would have been a big surprise!) > This is fairly off-topic in comp.lang.ada, but just for the record: while it is true that Pascal does NOT have structural type equivalence, type equivalence and type compatibility are NOT the same relationship. There are three type relationships in Pascal: (a) equivalence: the types denoted by identifiers T1 and T2 are equivalent iff T1 and T2 are the SAME identifier or the two are explicitly equated, thus: "type T2 = T1"; an anonymous type is equivalent to no other type (b) compatibility: as defined above; this is the relationship required between (e.g.) the type of a record's variant selector (~discriminant) and that of a case constant (~literal choice) (c) assignment compatibility: the relationship between the types of the two sides of an assignment (among other things); defined in terms of compatibility (among other things). Equivalence is required (e.g.) between the types of actual & formal VAR params; assignment compatibility between the types of actual & formal VALUE params. All of this was set out in British Standard BS 6192, first promulgated in 1979, and the parent of the ANS and ISO Pascal Standards. There have been essentially no definitional ambiguities in Pascal for the best part of 20 years. Plenty of time for everyone to catch up, one might think, but Pascal never recovered from an onslaught of ignorant deprecation very reminiscent of that directed a little later against Ada. Compiler writers who selectively ignored the Standard only added to the problem. Ada has held out against its detractors much better; in large part, I think, because its progenitors learned from the Pascal experience and ensured that a definitive standard was there from the start. -- Bill Findlay Department of Computing Science The University of Glasgow