aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorPreston Pan <preston@nullring.xyz>2024-01-07 18:37:30 -0800
committerPreston Pan <preston@nullring.xyz>2024-01-07 18:37:30 -0800
commit5907934e467bf28291901ed3595125ef1ed724d9 (patch)
treea51b4f1b2702673d18f39de5b39b2a37c26774ce /examples
parenta70b986d42c89def265a396f8cedd23c749be1f9 (diff)
add a lot of stuff and fix some bugs
Diffstat (limited to 'examples')
-rw-r--r--examples/aoc1.stem0
-rw-r--r--examples/math.stem2
-rw-r--r--examples/repl.stem1
3 files changed, 2 insertions, 1 deletions
diff --git a/examples/aoc1.stem b/examples/aoc1.stem
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/examples/aoc1.stem
diff --git a/examples/math.stem b/examples/math.stem
new file mode 100644
index 0000000..1a6f931
--- /dev/null
+++ b/examples/math.stem
@@ -0,0 +1,2 @@
+factorial [ dup 0 <= [ 1 + ] [ dup 1 - factorial * ] if ] func
+PI 3.1415926 func
diff --git a/examples/repl.stem b/examples/repl.stem
index a2faaaf..7f2010f 100644
--- a/examples/repl.stem
+++ b/examples/repl.stem
@@ -1,2 +1 @@
-"Welcome to the REPL; exit to exit\n" .
loop [ "> " . read strquote eval loop ] func loop