| 1 | (* Fmt.eprint flushes Out first: with standard error made standard |
| 2 | output, what was printed before comes before it. *) |
| 3 | module Eprint; |
| 4 | import Fmt, Out, Sys; |
| 5 | |
| 6 | proc main*; |
| 7 | begin |
| 8 | _ := Sys.dupTo(Sys.stdout, Sys.stderr); |
| 9 | Out.str("printed first, "); |
| 10 | Fmt.eprint("{} {}\n", [Fmt.str("then"), Fmt.int(2)]); |
| 11 | end; |
| 12 | |
| 13 | end Eprint. |