RosettaCodeData/Task/Associative-array-Iteration/E/associative-array-iteration.e
Ingy döt Net 764da6cbbb CDE
2013-04-10 16:57:12 -07:00

21 lines
331 B
Text

def map := [
"a" => 1,
"b" => 2,
"c" => 3,
]
for key => value in map {
println(`$key $value`)
}
for value in map { # ignore keys
println(`. $value`)
}
for key => _ in map { # ignore values
println(`$key .`)
}
for key in map.domain() { # iterate over the set whose values are the keys
println(`$key .`)
}