diff options
Diffstat (limited to 'chapter22/docs')
| -rw-r--r-- | chapter22/docs/examples/BubbleSort.smp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/chapter22/docs/examples/BubbleSort.smp b/chapter22/docs/examples/BubbleSort.smp index a80d6bd8..aa9cbbb8 100644 --- a/chapter22/docs/examples/BubbleSort.smp +++ b/chapter22/docs/examples/BubbleSort.smp @@ -5,10 +5,12 @@ // // Bubble sort, with reading (parsing) and writing (formatting) the data. + val _exit = { u8[~] msg -> sys.io.p(msg); sys.libc._exit(1); }; + val usage = { -> _exit("stdin must look like [4, 3, 2, 1]"); }; // Scanner @@ -23,6 +25,7 @@ val skip = { Scan s -> s.x++; }; + // Require specific syntax or usage val require = { Scan s, u8 c -> skip(s); |
