Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!sunic!tut!hydra!kreeta!grano From: grano@cs.Helsinki.FI (Kari Gran|) Newsgroups: comp.lang.c Subject: Re: C strongly typed? Message-ID: <4401@hydra.Helsinki.FI> Date: 9 Mar 90 00:30:18 GMT References: <259@eiffel.UUCP> <1990Mar1.172526.28683@utzoo.uucp> <849@enea.se> <2963@goanna.oz.au> Sender: news@cs.Helsinki.FI Organization: University of Helsinki, Department of Computer Science Lines: 30 In article <2963@goanna.oz.au> ok@goanna.oz.au (Richard O'keefe) writes: !Try it in Ada (not checked, as I haven't access to an Ada compiler): ! declare ! subtype apple is integer; ! subtype orange is integer; ! a: apple; ! o: orange := 1; ! begin ! a := o; ! end !Again, the assignment is well-typed. Why should C be different? But you're using Ada's _subtypes_, which hide the fact that Ada is a strictly (strongly? - not well defined terms anyway) typed language. If you try declare type apple is integer; type orange is integer; a : apple; o : orange; begin a:= o; end; then the types aren't any longer compatible and the assignment is thus illegal. Kari. -- Kari Grano grano@cs.helsinki.fi Hey, my opinions are just mine.. "I've got a thousand telephones that don't ring" - R.Z.