From 1de7dce41495a57404cefc6ecf3991c66e30f3ec Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Sun, 20 May 2018 22:35:14 +0200 Subject: dict: Document, add release snippet --- docs/markdown/snippets/dict_builtin.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 docs/markdown/snippets/dict_builtin.md (limited to 'docs/markdown/snippets') diff --git a/docs/markdown/snippets/dict_builtin.md b/docs/markdown/snippets/dict_builtin.md new file mode 100644 index 0000000..b60fd0a --- /dev/null +++ b/docs/markdown/snippets/dict_builtin.md @@ -0,0 +1,19 @@ +## New built-in object dictionary + +Meson dictionaries use a syntax similar to python's dictionaries, +but have a narrower scope: they are immutable, keys can only +be string literals, and initializing a dictionary with duplicate +keys causes a fatal error. + +Example usage: + +```meson +dict = {'foo': 42, 'bar': 'baz'} + +foo = dict.get('foo') +foobar = dict.get('foobar', 'fallback-value') + +foreach key, value : dict + # Do something with key and value +#endforeach +``` -- cgit v1.1 From 10e7566ed84251dcec6ee4ff3cc721e38fb90457 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Mon, 21 May 2018 00:19:31 +0200 Subject: dict: fix CI issues --- docs/markdown/snippets/dict_builtin.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/markdown/snippets') diff --git a/docs/markdown/snippets/dict_builtin.md b/docs/markdown/snippets/dict_builtin.md index b60fd0a..1bd24ce 100644 --- a/docs/markdown/snippets/dict_builtin.md +++ b/docs/markdown/snippets/dict_builtin.md @@ -14,6 +14,6 @@ foo = dict.get('foo') foobar = dict.get('foobar', 'fallback-value') foreach key, value : dict - # Do something with key and value -#endforeach + Do something with key and value +endforeach ``` -- cgit v1.1