<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 07/02/18 15:13, Wolf wrote:<br>
</div>
<blockquote type="cite"
cite="mid:7209b3ba-27e6-958f-b2be-a62c9e0d7771@gmail.com">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<p>Not so long ago, Florian was proudly bragging about "Pascal
does not allow you to <a moz-do-not-send="true"
href="http://www.toodarkpark.org/computers/humor/shoot-self-in-foot.html">shoot
yourself in the foot</a>"</p>
<p>What about this little program:</p>
<p>program Project1;<br>
<br>
var a,b: byte;<br>
begin<br>
a:=1;<br>
b:=a*(-1);<br>
writeln(b); // result: 255<br>
end.<br>
<br>
</p>
<p>The result is obviously correct, given how the variables are
declared. But there are no compiler warnings / errors that the
assignment b:=a*(-1) is fishy, to put it mildly. And if you are
serious about strong typing, it ought to be illegal, with a
suitable complaint from the compiler.</p>
<p>Who is shooting whom in the foot?</p>
<p>Wolf<br>
</p>
<br>
<br>
</blockquote>
<br>
Should the compiler balk at this as well?<br>
<br>
program Project1;<br>
<br>
var a,b,c: byte;<br>
begin<br>
a:=5;<br>
b:=6;<br>
c:=a-b;<br>
writeln(c); // result: 255<br>
end.<br>
<br>
Without the implicit conversion of signed/unsigned values, the
utility of the language is greatly diminished.<br>
<br>
-Jim<br>
<br>
</body>
</html>