raz / conform / run / DeferStop.raz

15 lines · 324 B · raw · history · last change 7e721e08

1(* A failed check ends the program without running the deferred
2 statements still pending; what the program wrote is still out. *)
3module DeferStop;
4import Out;
5
6proc main*;
7var a: [3]I64; i: INT;
8begin
9 defer Out.str("deferred\n");
10 Out.str("before\n");
11 i := ARGC() + 4;
12 Out.int(a[i]);
13end;
14
15end DeferStop.