From 5d7eed48337ff1f9a30118f5d8be67c641bbfcf8 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Tue, 5 Jan 2021 17:18:55 +0300 Subject: Added sx showcase. --- examples/generated.csx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'examples') diff --git a/examples/generated.csx b/examples/generated.csx index f6eac72..14943b2 100644 --- a/examples/generated.csx +++ b/examples/generated.csx @@ -17,6 +17,16 @@ [set c [in]] [if [no [same c 10]] [pair c [instr]]] ]] +[set outints [fn [l] + [set outcontent [fn [l] + [if l [do [outint [head l]] [out 32] [outcontent [tail l]]]] + ]] + [out 91] [outcontent l] [out 93] +]] +[set rappend [fn [a b] [if a [rappend [tail a] [pair [head a] b]] b]]] +[set rev [fn [l] [rappend l []]]] +[set append [fn [a b] [rappend [rev a] b]]] +[set backwards [sx body [pair 'do [rev body]]]] [outstr "-= loaded =-"] [newline] @@ -30,3 +40,8 @@ [newline] [outstr "I have to go. Goodbye!"] [newline] + +[backwards + [outstr magic] + [set magic [rev "magic"]] +] -- cgit v1.2.3