diff options
Diffstat (limited to 'src/content/chapter4_standard_library/lesson03_dict_module/en.html')
-rw-r--r-- | src/content/chapter4_standard_library/lesson03_dict_module/en.html | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/content/chapter4_standard_library/lesson03_dict_module/en.html b/src/content/chapter4_standard_library/lesson03_dict_module/en.html new file mode 100644 index 0000000..f7eb879 --- /dev/null +++ b/src/content/chapter4_standard_library/lesson03_dict_module/en.html @@ -0,0 +1,40 @@ +<p> + The + <a href="https://hexdocs.pm/gleam_stdlib/gleam/dict.html" + ><code>gleam/dict</code></a + > + standard library module defines Gleam's <code>Dict</code> type and functions + for working with it. A dict is a collection of keys and values which other + languages may call a hashmap or table. +</p> + +<p> + <a href="https://hexdocs.pm/gleam_stdlib/gleam/dict.html#new" + ><code>new</code></a + > + and + <a href="https://hexdocs.pm/gleam_stdlib/gleam/dict.html#from_list" + ><code>from_list</code></a + > + can be used to create new dicts. +</p> + +<p> + <a href="https://hexdocs.pm/gleam_stdlib/gleam/dict.html#insert" + ><code>insert</code></a + > + and + <a href="https://hexdocs.pm/gleam_stdlib/gleam/dict.html#delete" + ><code>delete</code></a + > + are used to add and remove items from a dict. +</p> +<p> + Like lists, dicts are immutable. Inserting or deleting an item from a dict + will return a new dict with the item added or removed. +</p> +<p> + Dicts are unordered! If it appears that the items in a dict are in a certain + order this is incidental and should not be relied upon. Any ordering may + change without warning in future versions or on different runtimes. +</p> |