java,python,data-structures,datapersistance,immutablelist
In your example, name is a reference that points to a value. In your first line, name points to the immutable string "nice name". Then in your second line, you update name to point to a different immutable string "bad name". At this point, no variable references "nice name" -...
java,immutablelist,structural-sharing
public static final ImmutableList<Foo> result = new ImmutableList.Builder<Foo>() .addAll(originalList) .add(new Foo()) .build(); ...
c#,immutablelist,immutable-collections
Unlike List<T> which wraps around an array that is resized as needed, ImmutableList<T> internally uses an immutable AVL tree (see Channel9 video discussing this). So how can I still achieve this using Immutable Collections? Use ImmutableArray<T>. Quoting from a .NET Framework blog post about Immutable Collections Reasons to use immutable...