raz / test / run / OutLines.raz

20 lines · 570 B · raw · history · last change 6e2a4e15

1module OutLines;
2(* Out.lines(true) writes each line as it ends, though standard output
3 is no terminal here: the lines come in order with what is written
4 past Out. lines(false) keeps them until the end. *)
5import Out, Sys;
6
7proc main*;
8begin
9 Out.lines(true);
10 Out.str("first\n");
11 _ := Sys.write(Sys.stdout, "past Out\n");
12 Out.str("second, half");
13 _ := Sys.write(Sys.stdout, "past Out again\n");
14 Out.str(" and the rest\n");
15 Out.lines(false);
16 Out.str("kept\n");
17 _ := Sys.write(Sys.stdout, "past Out, first\n");
18end;
19
20end OutLines.