fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.
Fuzion
•
Idioms
•
Idiom # 13: Iterate over map keys and values
Idiom # 13: Iterate over map keys and values
See
programming-idioms.org
:
Code
mymap.items ! t -> say "{t.0} => {t.1}" # NYI: with more syntactic sugar, this should become # # mymap.items ! k,v -> say "$k => $v"
What are effects?
Running Example
mymap := container.ordered_map ["one", "two"] [1, 2] mymap.items ! t -> say "{t.0} => {t.1}"
What are effects?
last changed: 2024-07-01
next: Idiom # 14: Pick uniformly a random floating point number in [a..b)