From 288912d2a84d035730cad405e32a6afa5dd4f9c6 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Sat, 10 May 2025 10:55:15 -0700 Subject: Move sys.smp to smp directory --- chapter22/docs/examples/BubbleSort.smp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'chapter22/docs') 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); -- cgit v1.2.3