aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/loop.lyn6
-rw-r--r--examples/primitive.lyn5
2 files changed, 11 insertions, 0 deletions
diff --git a/examples/loop.lyn b/examples/loop.lyn
new file mode 100644
index 0000000..0304672
--- /dev/null
+++ b/examples/loop.lyn
@@ -0,0 +1,6 @@
+let sum 0
+for {let i 0} {< i 1000000} {set i (+ i 1)} {
+ set sum (+ sum i)
+}
+
+println sum
diff --git a/examples/primitive.lyn b/examples/primitive.lyn
new file mode 100644
index 0000000..4ebcf74
--- /dev/null
+++ b/examples/primitive.lyn
@@ -0,0 +1,5 @@
+let x 0
+println x
+
+set x 1
+println x