auto in(int min, int max) { return [=](int x){ return min <= x && x <= max; }; } in_2_3: (x: int) -> bool = 2 <= x && x <= 3; main: ()->int = { v: std::variant = (); v = "rev dodgson"; test(v); o: std::optional = (); test(o); o = 42; test(o); a: std::any = 0; test(a); a = "plugh" as std::string; test(a); test(0); test(1); test(2); test(3); test(-42); test("xyzzy" as std::string); test(3.14); } test: (x:_) = { forty_two := 42; std::cout << inspect x -> std::string { is 0 = "zero"; is (in(1,2)) = "1 or 2"; is (in_2_3) = "3"; is (forty_two) = "the answer"; is int = "integer " + cpp2::to_string(x); is std::string = x as std::string; is _ = "(no match)"; } << "\n"; }