From c223307877f2eab1906bf2fbc6d31c03dfcdcfbc Mon Sep 17 00:00:00 2001 From: flaviut Date: Sat, 15 Nov 2014 05:55:45 -0800 Subject: [PATCH] Updated Common Criticisms (markdown) --- Common-Criticisms.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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}`.