Sharing and copying lists and maps
Two names can refer to the same list or map. Picture two labels stuck on one box. A second label is an alias, not a second box: changing an item through either name changes the shared collection.
A deep copy would create separate copies of the box and all collections inside it. Ordinary assignment and passing an argument do not do that. repeatList does make independent copies of nested collections for its repeated items. See changing and sharing values.
Assigning or passing a List or Map copies the value while sharing its
mutable collection storage. Updating an element through one alias is therefore
visible through another alias:
# language: en
let original = [0, 0]
let alias = original
set alias[0] = 9
say original # [9, 0]
Use repeatList when repeated nested collections must be independent. There is
no general-purpose user-visible deep-copy function in the current library.
