Add Nim Dictionaries

This commit is contained in:
rsirres 2016-12-29 15:26:31 +01:00
parent 554ce29e33
commit bb54d8ae7e
1 changed files with 11 additions and 0 deletions

View File

@ -168,6 +168,17 @@ Use [Nim sequences](http://nim-lang.org/docs/tut1.html#advanced-types-sequences)
Nim arrays and sequences can hold only items of the same type. Nim arrays and sequences can hold only items of the same type.
### Python dictionaries
``` Nim
import tables
var a = {"hallo": "World", "Key2": "Value2"}.newTable
for key, value in a:
echo key, " " ,value
```
#### List Comprehensions #### List Comprehensions
``` ```
import future # required for the list comprehension syntactical sugar import future # required for the list comprehension syntactical sugar