diff options
author | Axel Pahl <axelpahl@gmx.de> | 2016-07-12 10:45:54 +0200 |
---|---|---|
committer | Axel Pahl <axelpahl@gmx.de> | 2016-07-12 10:45:54 +0200 |
commit | 6de1333a26844a1749d2795f111ceccc2debc886 (patch) | |
tree | 77dba8b8521e9258704b9974a67f057aadc1e0cb /lib | |
parent | 8d4614b5ab4fbf8ccb34875c2c2f1e7dcddcc2ee (diff) | |
download | Nim-6de1333a26844a1749d2795f111ceccc2debc886.tar.gz |
use table literal syntax
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/collections/tables.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pure/collections/tables.nim b/lib/pure/collections/tables.nim index 9feea3746..941516956 100644 --- a/lib/pure/collections/tables.nim +++ b/lib/pure/collections/tables.nim @@ -24,7 +24,7 @@ ## import tables ## ## var -## a = toTable([(1, "one"), (2, "two")]) # creates a Table +## a = {1: "one", 2: "two"}.toTable # creates a Table ## b = a ## ## echo a, b # output: {1: one, 2: two}{1: one, 2: two} @@ -40,7 +40,7 @@ ## import tables ## ## var -## a = newTable([(1, "one"), (2, "two")]) # creates a TableRef +## a = {1: "one", 2: "two"}.newTable # creates a TableRef ## b = a ## ## echo a, b # output: {1: one, 2: two}{1: one, 2: two} |