cda-group / arc

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

Make it possible to access enums by path #228

Closed segeljakt closed 3 years ago

segeljakt commented 3 years ago

Now you can use the enum-api as:

    #[arcorn::rewrite]
    enum Foo {
        Bar(i32)
    }

    let foo = enwrap!(Foo::Bar, 5);
    assert!(is!(Foo::Bar, foo));
    assert_eq!(unwrap!(Foo::Bar, foo), 5);

Note: The old API is still supported. Eventually I will migrate to this in arc-script.