Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!think!snorkelwacker!mit-eddie!uw-beaver!Teknowledge.COM!unix!hplabs!hp-pcd!hp-sdd!ncr-sd!ncrcae!hubcap!billwolf%hazel.cs.clemson.edu From: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe, 2847 ) Newsgroups: comp.lang.c Subject: Re: C strongly typed? Message-ID: <8321@hubcap.clemson.edu> Date: 12 Mar 90 04:52:24 GMT References: <0500@sheol.UUCP> Sender: news@hubcap.clemson.edu Reply-To: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu Lines: 26 From article <0500@sheol.UUCP>, by throopw@sheol.UUCP (Wayne Throop): %> From: flc@n.sp.cs.cmu.edu (Fred Christianson) %> From Aho, Sethi and Ullman's _Compilers,_Principles,_Techniques,_and_Tools_: %> A language is strongly typed if its compiler can guarantee that %> the programs it accepts will execute without type errors ... %> For example if we first declare %> table: array[0..255] of char; %> i: integer %> and then compute table[i], a compiler cannot in general guarantee %> that during execution, the value of i will lie in the range 0 to 255. > > By this definition, are there ANY stronly typed languages in the > algol family? I can't think of any strongly typed languages by this > definition that are in what I'd call practial use. Can anybody else? > Certainly Ada, ModulaII, and Pascal all fail this test, do they not? No compiler could make such a guarantee. However, two points: 1) i should have been declared "integer range table'range;", which would have enabled the compiler to enforce the constraint... 2) even without the constraint, Ada's exception handling facility will handle the error by raising the predefined exception Numeric_Error. Bill Wolfe, wtwolfe@hubcap.clemson.edu