summaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
diff options
context:
space:
mode:
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r--docs/markdown/snippets/add_dict_values.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/markdown/snippets/add_dict_values.md b/docs/markdown/snippets/add_dict_values.md
new file mode 100644
index 000000000..0b97a704e
--- /dev/null
+++ b/docs/markdown/snippets/add_dict_values.md
@@ -0,0 +1,12 @@
+## Added a `values()` method for dictionaries
+
+Mesons built-in [[@dict]] type now supports the [[dict.values]] method
+to retrieve the dictionary values as an array, analogous to the
+[[dict.keys]] method.
+
+```meson
+dict = { 'b': 'world', 'a': 'hello' }
+
+[[#dict.keys]] # Returns ['a', 'b']
+[[#dict.values]] # Returns ['hello', 'world']
+```