diff --git a/Common-Criticisms.md b/Common-Criticisms.md index 682aa96..506788f 100644 --- a/Common-Criticisms.md +++ b/Common-Criticisms.md @@ -26,9 +26,9 @@ while in Nim they are written like type NodeKind = enum opValue, opAdd, opSub, opMul, opCall Node = ref object - case k: NodeKind + case kind: NodeKind of opValue: value: int of opAdd, opSub, opMul, opCall: kids: seq[Node] ``` -While the OCaml way looks better, the Nim version allows for multiple types to have the same values, without repetition. It also has the advantage that multiple variants can concisely be matched upon using sets like `{opSub, opMul}` +While the OCaml way looks better, the Nim version allows for multiple types to have the same values without repetition. It also has the advantage that multiple variants can concisely be matched upon using sets, eg `node.kind in {opSub, opMul}`.