aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2021-01-05 17:18:55 +0300
committerAleksey Veresov <aleksey@veresov.pro>2021-01-05 17:18:55 +0300
commit5d7eed48337ff1f9a30118f5d8be67c641bbfcf8 (patch)
tree918be41c07cd79cbf161103e7fd07d0241e54caa /examples
parent94f089316ffbf2e2e74b0257355f7c390ff5262b (diff)
downloadcsx-5d7eed48337ff1f9a30118f5d8be67c641bbfcf8.tar
csx-5d7eed48337ff1f9a30118f5d8be67c641bbfcf8.tar.xz
csx-5d7eed48337ff1f9a30118f5d8be67c641bbfcf8.zip
Added sx showcase.
Diffstat (limited to 'examples')
-rw-r--r--examples/generated.csx15
1 files changed, 15 insertions, 0 deletions
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"]]
+]