🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #6882

Re: C strongly typed?

#6882
From: Marc Sabatella
Date: Thu, 08 Mar 1990 16:49
25 lines
1243 bytes
>C strongly typed? If I write something like: (I don't speak C
>so the syntax is probably bogus.)
>
>    typedef apple int;
>    typedef orange int;
>    apple a;
>    orange b;
>    ...
>    a = b;
>
>Will a "modern" compiler object?

No.  C uses (mostly) "structural equivalence" for determining when two types
are compatible.  You seem to be saying that "strong typing" implies "name
equivalence", which is not the way we learned it.  There are three sets of
completely orthogonal distinctions here

strong vs weak typing (does everything have a type at compile time?)
name vs structural equivalence (when are two types equivalent?)
strict vs non-strict type checking (does the compiler allow type mismatches?)

C is strong, non-strict, and structural (although ANSI is quite a bit stricter
than K&R, it still has automatic type promotions).

Marc
Technical Details
Message-ID: <8960013@hpfcso.HP.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcso!mjs
References: <849@enea.se>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcso!mjs
From: mjs@hpfcso.HP.COM (Marc Sabatella)
Newsgroups: comp.lang.misc
Subject: Re: C strongly typed?
Message-ID: <8960013@hpfcso.HP.COM>
Date: 8 Mar 90 16:49:05 GMT
References: <849@enea.se>
Organization: Hewlett-Packard, Fort Collins, CO, USA
Lines: 25