--- freem/doc/freem.texi 2025/05/05 12:34:02 1.45 +++ freem/doc/freem.texi 2025/05/05 12:51:46 1.46 @@ -2011,7 +2011,6 @@ Identical to @ref{$TRANSLATE()}, except * !:: Run an external program or command. * !!:: Launch a subshell from FreeM direct mode. * ABLOCK:: Increment the block counter for one or more event classes. -* ASSERT:: Raise error when a conditional expression evaluates @emph{false}. * ASTART:: Enable asynchronous event handling for one or more event classes. * ASTOP:: Disable asynchronous event handling for one or more event classes. * AUNBLOCK:: Decrement the block counter for one or more event classes. @@ -2043,6 +2042,7 @@ Identical to @ref{$TRANSLATE()}, except * VIEW:: Modify FreeM internal parameters. * WRITE:: Write output to current input/output device. * XECUTE:: Interpret string as M code. +* ZASSERT:: Raise error when a conditional expression evaluates @emph{false}. * ZBREAK:: Unknown. * ZCONST:: Define a constant that cannot be altered after initial definition. * ZGO:: Unknown. @@ -2182,41 +2182,6 @@ In its inclusive form, @code{ABLOCK} inc In its exclusive form, @code{ABLOCK} increments the block counters for all event classes @emph{except for} those named in the list, provided the optional @emph{postcondition} is either @emph{true} or omitted. -@node ASSERT -@section ASSERT -@cindex ASSERT -@cindex commands, ASSERT -@cindex commands, debugging -@cindex commands, implementation-specific -@cindex commands, non-standard -@emph{FreeM Extension} - -Triggers error @code{ASSERT} if the supplied truth-valued expression @emph{tvexpr} is @emph{false} (@emph{1} is @emph{true}, and @emph{0} is @emph{false}), and that the optional @emph{postcondition} evaluates to @emph{true} or is omitted. - -The @code{ASSERT} error is catchable whether using standard-style, FreeM-style, or DSM 2.0-style error processing. - -@emph{Syntax} - -@example - ASSERT@emph{:postcondition} @emph{} -@end example - -@emph{Example} - -@example -DEFAULT.USER> SET DEBUG=1 - - -DEFAULT.USER> ASSERT:DEBUG 1=1 - - -DEFAULT.USER> ASSERT:DEBUG 1=0 - - ->> Error ZASSERT: programmer assertion failed in SYSTEM::^%SYSINIT [$STACK = 0] ->> ASSERT:DEBUG 1=0 - ^ -@end example @node ASTART @section ASTART @@ -3353,6 +3318,42 @@ VIEW 133:@emph{tvexpr} @cindex XECUTE @cindex commands, XECUTE +@node ZASSERT +@section ZASSERT +@cindex ZASSERT +@cindex commands, ZASSERT +@cindex commands, debugging +@cindex commands, implementation-specific +@cindex commands, non-standard +@emph{FreeM Extension} + +Triggers error @code{ZASSERT} if the supplied truth-valued expression @emph{tvexpr} is @emph{false} (@emph{1} is @emph{true}, and @emph{0} is @emph{false}), and that the optional @emph{postcondition} evaluates to @emph{true} or is omitted. + +The @code{ZASSERT} error is catchable whether using standard-style, FreeM-style, or DSM 2.0-style error processing. + +@emph{Syntax} + +@example + ZASSERT@emph{:postcondition} @emph{} +@end example + +@emph{Example} + +@example +DEFAULT.USER> SET DEBUG=1 + + +DEFAULT.USER> ZASSERT:DEBUG 1=1 + + +DEFAULT.USER> ZASSERT:DEBUG 1=0 + + +>> Error ZASSERT: programmer assertion failed in SYSTEM::^%SYSINIT [$STACK = 0] +>> ZASSERT:DEBUG 1=0 + ^ +@end example + @node ZBREAK @section ZBREAK @cindex ZBREAK @@ -5681,7 +5682,7 @@ Raised when you attempt to use multiple Raised when attempts are made to set @code{$ECODE} to an invalid error code value. Obsolete and replaced by standard error code @code{M101}. @item @code{ZASSERT} - @emph{programmer assertion failed} -Raised when an @code{ASSERT} expression's result is not true. +Raised when an @code{ZASSERT} expression's result is not true. @item @code{ZUSERERR} - @emph{user-defined error} Raised when program code calls @code{THROW} with an error code argument for which the first character is @code{U}, or when @code{$ECODE} is set to an error code for which the first character is @code{U}.