diff options
| author | Cliff Click <cliffc@acm.org> | 2025-05-10 10:55:15 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2025-05-10 10:55:15 -0700 |
| commit | 288912d2a84d035730cad405e32a6afa5dd4f9c6 (patch) | |
| tree | 30011f79d371d5f6f8ad8a3d869eccf22352b3e9 /chapter22/docs/examples | |
| parent | b4eb623979cc9566d2a22c718b4ba8ded3bca5a4 (diff) | |
| download | Simple-288912d2a84d035730cad405e32a6afa5dd4f9c6.tar.gz Simple-288912d2a84d035730cad405e32a6afa5dd4f9c6.zip | |
Move sys.smp to smp directory
Diffstat (limited to 'chapter22/docs/examples')
| -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); |
