Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!uflorida!mephisto!ncsuvx!news From: jwb@cepmax.ncsu.EDU (John W. Baugh Jr.) Newsgroups: comp.lang.c Subject: Re: C strongly typed? Message-ID: <1990Mar8.142433.13559@ncsuvx.ncsu.edu> Date: 8 Mar 90 14:24:33 GMT References: <2963@goanna.oz.au> <259@eiffel.UUCP> <1990Mar1.172526.28683@utzoo.uucp> <849@enea.se> Sender: news@ncsuvx.ncsu.edu (USENET News System) Reply-To: jwb@cepmax.ncsu.edu Organization: North Carolina State University Lines: 33 In article <2963@goanna.oz.au>, ok@goanna.oz.au (Richard O'keefe) writes: > In article <849@enea.se>, sommar@enea.se (Erland Sommarskog) writes: > > C strongly typed? If I write something like: (I don't speak C > > so the syntax is probably bogus.) > > [some C code] > > Will a "modern" compiler object? > > No, of course not. Try it in Pascal: > [some Pascal code] > A Pascal compiler may complain that "o" is uninitialised, but it > *must* accept the assignment as well-typed. (I tried it.) I think the issue here is "type equivalence," i.e., the relation that determines whether or not two types are compatible, assignable, etc. Equivalence mechanisms range from structural equivalence (fairly loose) to name equivalence (tight). Although the original Pascal definition was silent on the issue of type equivalence, I was under the impression that the recent ISO/ANSI Pascal standard defined equivalence based on name. For example, giving the definitions: type t1 = array[1..3] of boolean; t2 = array[1..3] of boolean; var v1 : t1; v2 : t2; the types of v1 and v2 are distinct under name equivalence, but equal under structural equivalence. John Baugh