Xref: utzoo comp.lang.misc:3890 comp.software-eng:2758 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!uunet!mcsun!sunic!enea!sommar From: sommar@enea.se (Erland Sommarskog) Newsgroups: comp.lang.misc,comp.software-eng Subject: Re: An Interesting View of "Strong" Vs. "Weak" Typing Message-ID: <639@enea.se> Date: 14 Jan 90 13:35:31 GMT References: <1990Jan12.104012.4426@cs.eur.nl> Organization: Enea Data AB, Sweden Lines: 20 Reino de Boer (reino@cs.eur.nl) writes: > Example: > Strong type checking in Pascal would give the programmer the > opportunity to get a compiler error on the following: > program wrong( output ); > type distance = real; > money = real; > var d : distance; > m : money; > begin d := 5.5; m := 10.0; writeln( d + m : 10 : 2 ) end. WOULD give, yes, if Pascal had been a strongly typed language. Alas, the typing in Pascal is fairly weak, so there is no possibility for a programmer to enforce distinction between two entities that have no connection to each other than being represented by a real or integer number. But of course there are languages which give you this possibility, but I doubt that Wirth designed any of them. -- Erland Sommarskog - ENEA Data, Stockholm - sommar@enea.se Unix is a virus.