Updated Common Criticisms (markdown)

This commit is contained in:
flaviut 2014-11-15 05:55:45 -08:00
parent 57d86f1045
commit c223307877
1 changed files with 2 additions and 2 deletions

View File

@ -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}`.