fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.
Fuzion
•
Idioms
•
Idiom # 8: Initialize a new map (associative array)
Idiom # 8: Initialize a new map (associative array)
See
programming-idioms.org
:
Code
x := container.map_of [("one", 1), ("two", 2)] /* NYI: with better syntactic sugar, this should become x := [ "one" => 1, "two" => 2 ] */
What are effects?
Running Example
ex8 is x := container.map_of [("one", 1), ("two", 2)] /* NYI: with better syntactic sugar, this should become x := [ "one" => 1, "two" => 2 ] */ for s in ["one", "two", "three"] do say "$s maps to {x[s]}"
What are effects?
last changed: 2024-07-01
next: Idiom # 9: Create a Binary Tree data structure