Caterpillar

Daily Thought - 2024-10-05

< back to list

Caterpillar is currently using {} to delineate functions. Here's an example of that:

{
    \ a 0 ->
        a

    \ a b ->
        a b +
}

This is a function with two branches. The first branch is executed, if the second argument is 0; the second branch is executed otherwise.

I'm thinking about replacing the braces with new fn and end keywords:

fn
    \ a 0 ->
        a

    \ a b ->
        a b +
end

In my opinion, this has two advantages:

But it would also introduce two new keywords, which then would not be available as function names.

<< previous thoughtnext thought >>