From 4dc2cafb17c2dbdb58ada3a200e843a894bfc113 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 16 Apr 2024 16:07:21 +0200 Subject: expression language: add array access by index --- doc/concepts/expressions.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'doc/concepts/expressions.md') diff --git a/doc/concepts/expressions.md b/doc/concepts/expressions.md index 192952f4..25da0fc8 100644 --- a/doc/concepts/expressions.md +++ b/doc/concepts/expressions.md @@ -354,6 +354,16 @@ those) argument(s) to obtain the final result. `"default"` argument (with default `null`) is evaluated and returned. + - `"[]"` This function takes two keyword arguments, `"index"` and + `"list"`. The `"list"` argument has to evaluate to a list. The + `"index"` argument has to evaluate to either a number (which + is then rounded to the nearest integer) or a string (which + is interpreted as an integer). If the index obtained in this + way is valid for the obtained list, the entry at that index + is returned; negative indices count from the end of the list. + Otherwise the `"default"` argument (with default `null`) is + evaluated and returned. + #### Constructs related to reporting of user errors Normally, if an error occurs during the evaluation the error is -- cgit v1.2.3