You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.
This shows you the differences between two versions of the page.
types:list [2021-02-01 08:51 SLT] sei Clarify the situation with keys |
types:list [2021-02-01 09:00 SLT] (current) sei Info on passing lists by reference |
||
---|---|---|---|
Line 145: | Line 145: | ||
Basically, the rule isn't whether the strings are equal, but whether they are handled verbatim without applying operations to them. The same trick fails with other types, including keys; adding e.g. a key variable to a list multiple times, results in one new instance of the key being counted for every addition. Same happens for integers, for example. But extracting them as lists still works. | Basically, the rule isn't whether the strings are equal, but whether they are handled verbatim without applying operations to them. The same trick fails with other types, including keys; adding e.g. a key variable to a list multiple times, results in one new instance of the key being counted for every addition. Same happens for integers, for example. But extracting them as lists still works. | ||
+ | |||
+ | Lists are passed by reference to functions, meaning that when passing a list to a function, a new copy is not created, but instead the same list is used. | ||
=== Limits === | === Limits === |