Document that dicts can be indexed with []

pull/12170/head
Bruce Merry 1 year ago committed by Xavier Claessens
parent 08ad7e770c
commit cd30d1889f
  1. 9
      docs/markdown/Syntax.md

@ -454,6 +454,15 @@ Keys must be unique:
my_dict = {'foo': 42, 'foo': 43}
```
Accessing elements of a dictionary works similarly to array indexing:
```meson
my_dict = {'foo': 42, 'bar': 'baz'}
forty_two = my_dict['foo']
# This will fail
my_dict['does_not_exist']
```
Dictionaries are immutable and do not have a guaranteed order.
Dictionaries are available since 0.47.0.

Loading…
Cancel
Save