🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #793

Re: An Interesting View of "Strong" Vs. "Weak" Typing

#793
From: Erland Sommarskog
Date: Sun, 14 Jan 1990 13:35
21 lines
1268 bytes
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.
Technical Details
Message-ID: <639@enea.se>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!uunet!mcsun!sunic!enea!sommar
References: <1990Jan12.104012.4426@cs.eur.nl>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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