Template:Prelude/general.a68
COMMENT This is an ALGOL 68 prelude file called prelude/general. It contains small routine that are not part of any standard, but are none the less useful and widely used. USAGE PR READ "prelude/general.a68" PR END COMMENT
- Define some general routines and MODES #
MODE UTFCHAR = STRING; MODE UTF=FLEX[0]UTFCHAR; MODE SIMPLEOUT = [0]UNION(INT, CHAR, STRING, []STRING); MODE MOID = VOID; # Use in cases where the OP should really return a MODE #
PROC raise exception = (STRING type, SIMPLEOUT argv)VOID:(
BOOL exception = FALSE; putf(stand error, ($g$, "Exception"," ",type, ": ", argv, $l$)); ASSERT (exception)
);
PROC raise undefined = (SIMPLEOUT argv)VOID:
raise exception("Undefined", argv);
PROC raise value error = (SIMPLEOUT argv)VOID:
raise exception("Value Error",argv);