aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorc+12023-05-13 14:35:27 -0400
committerc+12023-05-13 14:35:27 -0400
commitc8d473a2e6bfcb463ca4fb3613cf73db8d74e479 (patch)
tree1c6ba184c1291b74759a03f71b851ba6a0866ddb /examples
parentce63a4ea610bc80e9862c799633e07d3e896fe92 (diff)
real
Diffstat (limited to 'examples')
-rw-r--r--examples/functional.halk1
-rw-r--r--examples/hello.halk8
2 files changed, 5 insertions, 4 deletions
diff --git a/examples/functional.halk b/examples/functional.halk
index 758559c..ba61210 100644
--- a/examples/functional.halk
+++ b/examples/functional.halk
@@ -7,3 +7,4 @@ let.Y => {
λ.x => f.x.x;
}.λ.x => f.x.x;
}
+
diff --git a/examples/hello.halk b/examples/hello.halk
index 690fb5e..f6a7c9f 100644
--- a/examples/hello.halk
+++ b/examples/hello.halk
@@ -17,13 +17,13 @@ fn.greeting,to -> { [functions defined with
do not prefix it with a namespace/]
};
-fn.sum_all._ -> { [variadic functions are possible with the reserved '_' argument,
+fn.sum_all,_ -> { [variadic functions are possible with the reserved '_' argument,
which is treated as an array]
return.foldl.sum,0,_;
};
-fn.fibonacci.n -> {
- if.or.(=.n, 0), (=.n, 1) -> { [functions ending in '?' should be predicates]
+fn.fibonacci,n -> {
+ if.or.(=.n, 0), (=.n, 1) -> { [functions ending in '?' should be predicates]
return.1;
};
return.sum.
@@ -31,7 +31,7 @@ fn.fibonacci.n -> {
(fibonacci. sub.n, 2);
};
-fn.main -> { [where our code will begin executing]
+fn.main -> { [where our code will begin executing]
greeting.[comments can be placed *anywhere*]"world.";
exit.0; [exit with code 0 for success]
};