diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/functional.halk | 1 | ||||
-rw-r--r-- | examples/hello.halk | 8 |
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] }; |