Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!ukc!inmos!mph@lion.inmos.co.uk From: mph@lion.inmos.co.uk (Mike Harrison) Newsgroups: comp.lang.c Subject: Re: C strongly typed? Message-ID: <4440@ganymede.inmos.co.uk> Date: 9 Mar 90 10:47:48 GMT References: <259@eiffel.UUCP> <1990Mar1.172526.28683@utzoo.uucp> <849@enea.se> <2963@goanna.oz.au> Sender: news@inmos.co.uk Reply-To: mph@inmos.co.uk (Mike Harrison) Organization: INMOS Limited, Bristol, UK. Lines: 38 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? Yes, but instead try: declare type APPLE is new INTEGER; type ORANGE is new INTEGER; A: APPLE; O: ORANGE := 1; begin A := O; end This assignment IS illegal, though you could write: A := APPLE(O); which performs an explicit type conversion. Mike, Michael P. Harrison - Software Group - Inmos Ltd. UK. ----------------------------------------------------------- UK : mph@inmos.co.uk with STANDARD_DISCLAIMERS; US : mph@inmos.com use STANDARD_DISCLAIMERS;