table constructors now mimic more closely the syntax of case... of...

see the safePrintF example in the manual as a motivation
This commit is contained in:
Zahary Karadjov 2012-09-29 18:43:41 +03:00
commit 92f70b08f9
3 changed files with 47 additions and 7 deletions

View file

@ -2244,10 +2244,10 @@ Table constructor
A `table constructor`:idx: is syntactic sugar for an array constructor:
.. code-block:: nimrod
{"key1": "value1", "key2": "value2"}
{"key1": "value1", "key2", "key3": "value2"}
# is the same as:
[("key1", "value1"), ("key2", "value2")]
[("key1", "value1"), ("key2", "value2"), ("key3", "value")]
The empty table can be written ``{:}`` (in contrast to the empty set