From b70fefba0f15415ebe88bd50d6a2d2606f9afc5e Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 31 May 2022 16:58:02 +0200 Subject: "enumerate" expression: add padding to 10 characters --- doc/concepts/expressions.org | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'doc/concepts') diff --git a/doc/concepts/expressions.org b/doc/concepts/expressions.org index 895b5e0a..5b7e2f2c 100644 --- a/doc/concepts/expressions.org +++ b/doc/concepts/expressions.org @@ -212,9 +212,13 @@ those) argument(s) to obtain the final result. "$1": "3"}~ evaluates to ~["0", "1", "2"]~. - ~"enumerate"~ The argument has to be a list. The result is a map - containing one entry for each element of the list; the key is the - decimal representation of the position in the list (starting from - ~0~) and the value is the element. + containing one entry for each element of the list. The key is + the decimal representation of the position in the list (starting + from ~0~), padded with leading zeros to length at least 10. The + value is the element. The padding is chosen in such a way that + iterating over the resulting map (which happens in lexicographic + order of the keys) has the same iteration order as the list for + all lists indexable by 32-bit integers. - ~"++"~ The argument has to be a list of lists. The result is the concatenation of those lists. -- cgit v1.2.3