Post by Bill LearyDoes Oberon-7 still support the comple-out option?
When talking about Oberon-07 be careful to distinguish between 'Oberon-07
the language' and a particular 'implementation of Oberon-07' Compile-time
options are completely absent from the language report - it is intended to
be as platform-agnostic as is possible. AFAIR the same applied to the
design of Pascal and Modula-2. Compile-time options are
implementation-specific details. It is the responsibility of whoever is
implementing an Oberon-07 system to determine whether the specific
requirements of whichever particular system (which may exist now or even
sometime in the future) they are targeting . They are not a prescriptive
part of the Oberon-07 language itself.
Note that a compile-time option is not the *only* possible solution to
satisfy those who prefer to have the option of switching assertions on / off
. There are other possible implementation-specific mechanisms that don't
need compile-time options or need to be spelt out as additional features in
the design of the *language*.
For example I can imagine (but not necessarily encourage) a scheme that
could allow multiple-levels of enabling / disabling assertions all under
programmer control without a runtime performance hit, as follows:
a) It is feasible that an optimising compiler could statically determine
that it was unnecessary to generate ANY code for an assert statement of the
form:
ASSERT(TRUE, n)
b) If so, a programmer using that system could define a global constant e.g.
CONST
AssertLevel = 5;
c) Then throughout his code, for optional assertions he would write
something like:
ASSERT((AssertLevel > 3) & (param > 0), 100);
d) Then if he changed the constant to:
CONST
AssertLevel = 3;
and recompiled his program the previous ASSERT statement woul dbe optimised
away to nothing. However, any ASSERT statements with AssertLevels <= 3 would
still be activated.
Post by Bill LearyIf they're proposing that ASSERT(FALSE, n) is the replacment for HALT(n).
I'd expect not.
The substitute for HALT is ASSERT(FALSE) without the additional parameter
which, depending on the actual system in question, presumably would lead to
some sort of unconditional program termination.
The additional parameter on the general form of the ASSERT statement
indicates that the assertion handler can take alternative actions depending
on the value of the parameter. Depending on what the system was designed to
do, this could conceivably include an action where just a warning is
produced and processing then resumes from where the assertion failed. It all
depends on how the implementor chooses to interpret the word 'abort'.
--
Chris Burrows
CFB Software
Astrobe: ARM Oberon-07 Development System
http://www.astrobe.com