summaryrefslogtreecommitdiff
path: root/examples/inlinefunctions.fy
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-08-26 08:17:55 +0000
committerPaul Buetow <paul@buetow.org>2008-08-26 08:17:55 +0000
commit9bf07e1dfa69b5d6e4c296c0690b5ed91f909b7b (patch)
tree60f46be65a1fbaeed2f5deb1d4dbcf5ea68e0d01 /examples/inlinefunctions.fy
added v0.1 branch
Diffstat (limited to 'examples/inlinefunctions.fy')
-rw-r--r--examples/inlinefunctions.fy20
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/inlinefunctions.fy b/examples/inlinefunctions.fy
new file mode 100644
index 0000000..81848ce
--- /dev/null
+++ b/examples/inlinefunctions.fy
@@ -0,0 +1,20 @@
+#*
+ * Simple builtin function tests
+ *#
+
+# Print "-20\n"
+assert (neg 20) == (say neg 20);
+
+# Print "30\n"
+assert 30 == (say 10 - neg 20);
+
+# Print "-30\n"
+assert (neg 30) == (say neg neg neg 10 - neg 20);
+
+# Print "Hello\n"
+put "Hello";
+ln;
+
+# Exit with exit code 0
+exit 10 + 10 - 5 - 15;
+