This commit is contained in:
Ingy döt Net 2013-10-27 22:24:23 +00:00
parent 6f050a029e
commit 776bba907c
3887 changed files with 59894 additions and 7280 deletions

View file

@ -0,0 +1 @@
Dictionary = dict:from_list( lists:zip([key1, key2, key3], [value1, 2, 3]) ).

View file

@ -1,3 +1,7 @@
val keys = Array(1, 2, 3)
val values = Array("A", "B", "C")
val map = keys.zip(values).toMap
val keys = List(1, 2, 3)
val values = Array("A", "B", "C") // Array mixed with List
val map = keys.zip(values).toMap // and other Seq are possible.
// Testing
assert(map == Map(1 ->"A", 2 -> "B", 3 -> "C"))
println("Successfully completed without errors.")