cda-group / arc

Programming Language for Continuous Deep Analytics
https://cda-group.github.io/arc/
44 stars 6 forks source link

RFC (Syntax): Change paths from `::` to `.` or `:` #332

Closed segeljakt closed 1 year ago

segeljakt commented 2 years ago

Currently we have:

enum Foo { Bar(f32), Baz(i32) }

match foo {
    Foo::Bar(f) => Foo::Bar(f),
    Foo::Baz(i) => Foo::Baz(i)
}

The path syntax could be made more similar to Java, Scala, Python, OCaml, etc.

enum Foo { Bar(f32), Baz(i32) }

match foo {
    Foo.Bar(f) => Foo.Bar(f),
    Foo.Baz(i) => Foo.Baz(i)
}

Or Erlang:

enum Foo { Bar(f32), Baz(i32) }

match foo {
    Foo:Bar(f) => Foo:Bar(f),
    Foo:Baz(i) => Foo:Baz(i)
}

Both of these require a big modification to the parser, so I am hesitant right now to add it, but it's definitely on the bucket list.