Since what you're going for here isn't so much an enum as a type union, why not simply call it a union? Pro: Unambiguous and already a known concept. Con: It adds a keyword, and use of 'union' might interfere with existing set procedures. type Option[T] = union of None: discard of Some: T Either[A, B] = union of Le: A of Ri: T BinaryNode = object a, b: ref Node UnaryNode = object a: ref Node Node = union of BinaryOpr: BinaryNode of UnaryOpr: UnaryNode of Variable: string of Value: int Run
- Sum types, 2024 variant bajith
- Sum types, 2024 variant Araq
- Sum types, 2024 variant bajith
- Sum types, 2024 variant bajith
- Sum types, 2024 variant TKD
- Sum types, 2024 variant walkr
- Sum types, 2024 variant ingo
- Sum types, 2024 variant Nerve
- Sum types, 2024 variant hamidrb80
- Sum types, 2024 variant Chronos
- Sum types, 2024 variant crfout
- Sum types, 2024 variant xigoi
- Sum types, 2024 variant Araq
- Sum types, 2024 variant didlybom
- Sum types, 2024 variant Araq
- Sum types, 2024 variant Araq
- Sum types, 2024 variant ElegantBeef
- Sum types, 2024 variant Araq
- Sum types, 2024 variant walkr
- Sum types, 2024 variant Araq
- Sum types, 2024 variant walkr