4 ms·
You're assuming that x+[5] mutates the list instead of returning a new list. If you're planning to have multiple threads append items to a list, the immutable
by jfim 7y ago
You're assuming that x+[5] mutates the list instead of returning a new list.
If you're planning to have multiple threads append items to a list, the immutable way to do it is to have each thread return a list of items to append to the main list, then fold those items into the list.
- reitzensteinm 7y agoNo, parent post is definitely not assuming that.