8 test_output
("Constant expressions in script block", q
[
9 define numeric tx
= 42;
10 define numeric ty
= 24;
11 define tz
() returning numeric
{ return = 123; }
12 script
(tx
, ty
, tx
+ty
, tz
) { }
18 test_error
("Reject non-constant expression in script block", q
[
19 define tx
() returning numeric
{ return = norn
.x
; }
20 script
(tx
, 1, 1, 1) { }
21 ], "constant value expected");
23 test_error
("Reject side-effecting expression in script block", q
[
24 define tx
() returning numeric
{ print(42); return = 42; }
25 script
(tx
, 1, 1, 1) { }
26 ], "side-effects not allowed");