[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] HALT procedure
From: |
Gaius Mulley |
Subject: |
Re: [Gm2] HALT procedure |
Date: |
Thu, 28 Sep 2017 17:34:41 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
David Egan Evans <address@hidden> writes:
> The HALT procedure calls the C abort by default, which aborts the
> program abnormally. Though this isn't explicit in PIM, I believe it is
> in ISO/IEC 10514-1 (mainly because of the introduction of the parameter
> for the program return value).
>
> More specifically, I understood that HALT (without parameters) should
> behave as if the end of the program had been reached. This was added to
> compensate for the removal of the GOTO, which in Pascal was typically
> used to go the end of the file.
Hi,
firstly apologies for the delay in replying - I've been in the land of
doom3 and teaching preparation.
I've dug out my pim2, 3, 4 and ISO documents. It does appear to me
that HALT is designed for abnormal termination. Even in the PIM
examples XREF etc - the HALT always occurs if a fatal error is reached
(file was not opened) in the XREF example. Or in the processes
example a runtime problem is detected before HALT is called.
In ISO on page 40 it talks about
> a) the end of the normal part of the program module
> initialization body is reached,
> b) a RETURN statement is executed in the program module
> initialization body,
> c) the standard procedure HALT is called,
> d) an exception is raised and this exception is not handled.
and then goes on to categorise case (a) and (b) as normal termination.
Which I conclude that (c) and (d) are abnormal termination. So I think
the current implementation is correct - unless I've misunderstood
something?
regards,
Gaius
- Re: [Gm2] HALT procedure,
Gaius Mulley <=