Caterpillar

Daily Thought - 2024-10-06

< back to list

I've been envisioning (and previous Caterpillar prototypes have already done this) using [ and ] for list literals:

[ a b ] # `a` and `b` have the same type

I think that's a pretty common thing to do.

Following Rust's syntax, I'd like to use ( and ) for tuples:

( a b ) # `a` and `b` can have different types

And since I'm considering a syntax change that would free up { and }, those could be used for map and struct/record literals:

{
    x: 5
    y: 10
}

There are more details to figure out, but those are the broad strokes of what could go into the language.

<< previous thoughtnext thought >>