flang.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 -> { (k,v) := t; say "$k => $v" } # NYI: with more syntactic sugar, this should become # # mymap.items | (k,v) -> say "$k => $v"
What are effects?
Running Example
mymap := ordered_map ["one", "two"] [1, 2] mymap.items | t -> { (k,v) := t; say "$k => $v" }
What are effects?
next: Idiom # 14: Pick uniformly a random floating point number in [a..b)