From 17d6e6a265c44569f4533e12cc04442013ab3b3e Mon Sep 17 00:00:00 2001 From: c+1 Date: Fri, 12 May 2023 11:49:12 -0400 Subject: nothing workds help --- examples/hello.halk | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'examples/hello.halk') diff --git a/examples/hello.halk b/examples/hello.halk index e6dc1a4..690fb5e 100644 --- a/examples/hello.halk +++ b/examples/hello.halk @@ -7,7 +7,7 @@ let.hello -> 'hello, '; [variables must be given a value at declaration] -let.PI => math/PI; [namespaces are accessed with a '/'] +let.PI => math:PI; [namespaces are accessed with a ':''] [constants are denoted with a '=>'] fn.greeting,to -> { [functions defined with: `fn.,,..., -> {};`] @@ -19,14 +19,16 @@ fn.greeting,to -> { [functions defined with fn.sum_all._ -> { [variadic functions are possible with the reserved '_' argument, which is treated as an array] - return.foldl.+,0,_; + return.foldl.sum,0,_; }; fn.fibonacci.n -> { - if.or.(num=?.n, 0), (num=?.n, 1) -> { [functions ending in '?' should be predicates] + if.or.(=.n, 0), (=.n, 1) -> { [functions ending in '?' should be predicates] return.1; }; - return.+.(fibonacci. -.n, 1), (fibonacci. -.n, 2); [parens can be used to group function application] + return.sum. + (fibonacci. sub.n, 1), + (fibonacci. sub.n, 2); }; fn.main -> { [where our code will begin executing] -- cgit v1.2.3