On 06.02.25 20:37, o...@ocs.cz wrote:
[...]
Far as I know, there's no auto-extending unless you explicitly ask for
that by withDefault.

there is this:

def l = [1,2]
l[3] = 4
assert l == [1,2,null,4]

As you see it autoextended the list from 2 elements to 4. Reading does
not extend unless you use the with default construct:

def sample = [1,2,3].withDefault { index ->
    index % 2
}

assert sample[3] == 1
assert sample[4] == 0

bye Jochen

Reply via email to