From 9aee9ca1437a1c8961af371d139ba177ff6ac390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sat, 10 Oct 2020 01:53:10 +0200 Subject: [PATCH] add reverse example --- examples/stdio_rev.csn | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 examples/stdio_rev.csn diff --git a/examples/stdio_rev.csn b/examples/stdio_rev.csn new file mode 100644 index 0000000..bd4e00a --- /dev/null +++ b/examples/stdio_rev.csn @@ -0,0 +1,9 @@ +( + (mkbf r7) + (:r)(ld r0 @stdin) + (cmp r0 '\n' (eq? (j :q))) + (bfpush @r7 r0) + (j :r) + (:q)(bfpop @stdout @r7 (nem? (j :q))) + (ld @stdout '\n') +)