diff --git a/examples/listlength.lamb b/examples/listlength.lamb new file mode 100644 index 0000000..4cb0172 --- /dev/null +++ b/examples/listlength.lamb @@ -0,0 +1,4 @@ +sum([]) -> 0. +sum(x::xs) -> 1 + sum(xs). + +putstrln(itos(sum([1, 2, 3]))). \ No newline at end of file diff --git a/examples/listsum.lamb b/examples/listsum.lamb index 4cb0172..f171586 100644 --- a/examples/listsum.lamb +++ b/examples/listsum.lamb @@ -1,4 +1,4 @@ sum([]) -> 0. -sum(x::xs) -> 1 + sum(xs). +sum(x::xs) -> x + sum(xs). putstrln(itos(sum([1, 2, 3]))). \ No newline at end of file