<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 30/07/2019 10:29, Michael Van
Canneyt wrote:<br>
</div>
<blockquote type="cite"
cite="mid:alpine.DEB.2.21.1907301023350.10021@home">
<br>
<br>
On Tue, 30 Jul 2019, thaddy wrote:
<br>
<br>
<blockquote type="cite">Telling.
<br>
<blockquote type="cite">
<br>
NOTES
<br>
<br>
1. If it is possible to construct a program in which the
violation or
<br>
non-violation of this International Standard requires
knowledge of the
<br>
data read by the program or the implementation definition of
<br>
implementation-defined features, then violation of that
requirement is
<br>
classified as an error. Processors may report on such
violations of
<br>
the requirement without such knowledge, but there always
remain some
<br>
cases that require execution, simulated execution, or proof
procedures
<br>
with the required knowledge. Requirements that can be verified
without
<br>
such knowledge are not classified as errors.
<br>
</blockquote>
</blockquote>
<br>
Hm.
<br>
<br>
Even after reading this 5 times, I still am not sure I understand
the
<br>
above. The people who wrote this must have been either
extraordinary geniuses, or very confused minds.
<br>
<br>
Or else they wanted to give a befriended unemployed lawyer some
work.
<br>
But anyone writing such a paragraph deserves to be unemployed...
;)
<br>
<br>
How you're suppsed to construct a working & compliant
'processor' (I assume this means compiler or interpreter or
somesuch) after reading this is a mystery to me.
<br>
</blockquote>
<br>
Well if we make the following substitutions (to specialize the
statement for the case of fpc)<br>
<br>
processor = compiler<br>
error = run time error<br>
<br>
Then the firsts sentence:<br>
"If it is possible to construct a program <br>
in which the violation (*or
non-violation*) of this International Standard <br>
requires knowledge of the
data read by the program <br>
(* or the implementation definition of
implementation-defined features, *)<br>
then violation of that requirement is
classified as an error. "<br>
<br>
Says: if reading the source does not show if the data will be
correct, then none correct data shall be a run time error<br>
<br>
"Compiler may report on such violations of
<br>
the requirement without such knowledge"<br>
<br>
"such knowlededge" = knowing the data read <br>
If the compiler can say the data will not be correct, then it may
report at compile time.<br>
<br>
" but there always remain some
cases <br>
that require execution, simulated execution, or proof
procedures
<br>
with the required knowledge."<br>
<br>
Not all cases can be (reasonable) detected at compile time<br>
<br>
" Requirements that can be verified without
<br>
such knowledge are not classified as errors.
"<br>
<br>
(probably?): violations detected at compile time, are not (run
time?) errors.<br>
<br>
--------------------------------------------------------------<br>
So if the standard did say, that all values in the defined range of
the type of the variable (or result type of the expression in the
case) must have an entry in the case list, then the compiler is
allowed to bail out during compilation.<br>
<br>
But:<br>
"<span style="left: 332.046px; top: 383.003px; font-size: 16.4379px;
font-family: serif; transform: scaleX(1.09036);" class="">On
execution of the <span class="highlight">case</span>-statement
the <span class="highlight">case</span>-index shall be evaluated</span><span
style="left: 839.977px; top: 383.003px; font-size: 16.4379px;
font-family: serif; transform: scaleX(1.19102);">. That </span><span
style="left: 177.529px; top: 402.729px; font-size: 16.4379px;
font-family: serif; transform: scaleX(1.10037);" class="">value
shall then specify execution of the statement of the <span
class="highlight">case</span>-list-element closest-containing
the</span><span style="left: 177.529px; top: 422.454px; font-size:
16.4379px; font-family: serif; transform: scaleX(1.11029);"
class=""><span class="highlight">case</span>-constant denoting
that value</span><span style="left: 424.098px; top: 422.454px;
font-size: 16.4379px; font-family: serif; transform:
scaleX(1.16049);" class="">. One of the <span class="highlight">case</span>-constants
shall be equal to the value of the </span><span style="left:
177.529px; top: 442.18px; font-size: 16.4379px; font-family:
serif; transform: scaleX(1.09033);" class=""><span
class="highlight">case</span>-index upon entry to the <span
class="highlight">case</span>-statement</span><span style="left:
494.781px; top: 442.18px; font-size: 16.4379px; font-family:
serif; transform: scaleX(1.08542);">; otherwise, it shall be an
error."</span><br>
<br>
Only says, that the values that actually occur at runtime, must be
present. It does not say that the range of the type must be fully
present.<br>
<br>
if boolval <> false then <br>
case boolval of <br>
true: ;<br>
end;<br>
<br>
Is therefore valid. Even though the case has no entry for false. <br>
<br>
<br>
<br>
</body>
</html>