>>106670647
Also, it does not mean a 'block' per se. It mostly means 'or'. That's how ML languages like OCaml denote variants, which are based on Algebraic Data Types. AGDTs are based on type theory, "sum types" and "product types" which could be combined.
This OCaml code:
type foo =
| Bar of int
| Fizz of string
| Baz
Is equal to this Rust code:
enum Foo {
Bar(i32),
FIzz(String),
Baz
}
Is equal to this C code:
struct Foo {
enum {
Bar,
Fizz,
Baz
} type;
union {
int bar;
const char *fizz;
} as;
};
What this is a "sum of product" type.
I made an implementation of Zephyr ASDL, which uses type theory to denote the Abstract Syntax of a program, later generates a C program to be used as the AST of a language:
https://github.com/Chubek/ZephyrASDL