aboutsummaryrefslogtreecommitdiff
path: root/src/content/chapter4_standard_library/lesson03_dict_module/en.html
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2024-02-15 12:18:17 +0000
committerLouis Pilfold <louis@lpil.uk>2024-02-19 18:18:04 +0000
commitf70130322cd306268c5da12c1517dc5725615ae8 (patch)
tree2f047d58f0bd0c9438d57b42499d40d13fea73ad /src/content/chapter4_standard_library/lesson03_dict_module/en.html
parent63120914512bd4a3003788a7592ef3cc4ff32cf5 (diff)
downloadtour-f70130322cd306268c5da12c1517dc5725615ae8.tar.gz
tour-f70130322cd306268c5da12c1517dc5725615ae8.zip
text -> en
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.html40
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>