mutable object
   HOME

TheInfoList



OR:

In
object-oriented Object-oriented programming (OOP) is a programming paradigm based on the concept of " objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of p ...
and functional programming, an immutable object (unchangeable object) is an
object Object may refer to: General meanings * Object (philosophy), a thing, being, or concept ** Object (abstract), an object which does not exist at any particular time or place ** Physical object, an identifiable collection of matter * Goal, an ...
whose state cannot be modified after it is created.Goetz et al. ''Java Concurrency in Practice''. Addison Wesley Professional, 2006, Section 3.4. Immutability This is in contrast to a mutable object (changeable object), which can be modified after it is created. In some cases, an object is considered immutable even if some internally used attributes change, but the object's state appears unchanging from an external point of view. For example, an object that uses memoization to cache the results of expensive computations could still be considered an immutable object. Strings and other concrete objects are typically expressed as immutable objects to improve readability and runtime efficiency in
object-oriented programming Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of ...
. Immutable objects are also useful because they are inherently
thread-safe Thread safety is a computer programming concept applicable to multi-threaded code. Thread-safe code only manipulates shared data structures in a manner that ensures that all threads behave properly and fulfill their design specifications without uni ...
. Other benefits are that they are simpler to understand and reason about and offer higher security than mutable objects.


Concepts


Immutable variables

In
imperative programming In computer science, imperative programming is a programming paradigm of software that uses statements that change a program's state. In much the same way that the imperative mood in natural languages expresses commands, an imperative program ...
, values held in
program variable In computer programming, a variable is an abstract storage location paired with an associated symbolic name, which contains some known or unknown quantity of information referred to as a ''value''; or in simpler terms, a variable is a named cont ...
s whose content never changes are known as '' constants'' to differentiate them from variables that could be altered during execution. Examples include conversion factors from meters to feet, or the value of pi to several decimal places. Read-only fields may be calculated when the program runs (unlike constants, which are known beforehand), but never change after they are initialized.


Weak vs strong immutability

Sometimes, one talks of certain ''fields'' of an object being immutable. This means that there is no way to change those parts of the object state, even though other parts of the object may be changeable (''weakly immutable''). If all fields are immutable, then the object is immutable. If the whole object cannot be extended by another class, the object is called ''strongly immutable''. This might, for example, help to explicitly enforce certain invariants about certain data in the object staying the same through the lifetime of the object. In some languages, this is done with a keyword (e.g. const in
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
, final in
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mos ...
) that designates the field as immutable. Some languages reverse it: in OCaml, fields of an object or record are by default immutable, and must be explicitly marked with mutable to be so.


References to objects

In most object-oriented languages, objects can be referred to using references. Some examples of such languages are
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mos ...
,
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
, C#,
VB.NET Visual Basic, originally called Visual Basic .NET (VB.NET), is a multi-paradigm, object-oriented programming language, implemented on .NET, Mono, and the .NET Framework. Microsoft launched VB.NET in 2002 as the successor to its original Visua ...
, and many
scripting language A scripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system. Scripting languages are usually interpreted at runtime rather than compiled. A scripting ...
s, such as
Perl Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it also referred to its redesigned "sister language", Perl 6, before the latter's name was offic ...
,
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
, and
Ruby A ruby is a pinkish red to blood-red colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called ...
. In this case, it matters whether the state of an object can vary when objects are shared via references.


Referencing vs copying objects

If an object is known to be immutable, it is preferred to create a
reference Reference is a relationship between objects in which one object designates, or acts as a means by which to connect to or link to, another object. The first object in this relation is said to ''refer to'' the second object. It is called a '' name'' ...
of it instead of copying the entire object. This is done to conserve memory by preventing data duplication and avoid calls to constructors and destructors; it also results in a potential boost in execution speed. The reference copying technique is much more difficult to use for mutable objects, because if any user of a mutable object reference changes it, all other users of that reference see the change. If this is not the intended effect, it can be difficult to notify the other users to have them respond correctly. In these situations,
defensive copy In object-oriented programming, object copying is creating a copy of an existing object, a unit of data in object-oriented programming. The resulting object is called an ''object copy'' or simply ''copy'' of the original object. Copying is basic bu ...
ing of the entire object rather than the reference is usually an easy but costly solution. The
observer pattern In software design and engineering, the observer pattern is a software design pattern in which an object, named the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by ca ...
is an alternative technique for handling changes to mutable objects.


Copy-on-write

A technique that blends the advantages of mutable and immutable objects, and is supported directly in almost all modern hardware, is
copy-on-write Copy-on-write (COW), sometimes referred to as implicit sharing or shadowing, is a resource-management technique used in computer programming to efficiently implement a "duplicate" or "copy" operation on modifiable resources. If a resource is dupl ...
(COW). Using this technique, when a user asks the system to copy an object, it instead merely creates a new reference that still points to the same object. As soon as a user attempts to modify the object through a particular reference, the system makes a real copy, applies the modification to that, and sets the reference to refer to the new copy. The other users are unaffected, because they still refer to the original object. Therefore, under COW, all users appear to have a mutable version of their objects, although in the case that users do not modify their objects, the space-saving and speed advantages of immutable objects are preserved. Copy-on-write is popular in
virtual memory In computing, virtual memory, or virtual storage is a memory management technique that provides an "idealized abstraction of the storage resources that are actually available on a given machine" which "creates the illusion to users of a very ...
systems because it allows them to save memory space while still correctly handling anything an application program might do.


Interning

The practice of always using references in place of copies of equal objects is known as '' interning''. If interning is used, two objects are considered equal if and only if their references, typically represented as pointers or integers, are equal. Some languages do this automatically: for example,
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
automatically interns short strings. If the algorithm that implements interning is guaranteed to do so in every case that it is possible, then comparing objects for equality is reduced to comparing their pointers – a substantial gain in speed in most applications. (Even if the algorithm is not guaranteed to be comprehensive, there still exists the possibility of a
fast path Fast path is a term used in computer science to describe a path with shorter instruction path length through a program compared to the normal path. For a fast path to be effective it must handle the most commonly occurring tasks more efficiently th ...
case improvement when the objects are equal and use the same reference.) Interning is generally only useful for immutable objects.


Thread safety

Immutable objects can be useful in multi-threaded applications. Multiple threads can act on data represented by immutable objects without concern of the data being changed by other threads. Immutable objects are therefore considered more ''
thread-safe Thread safety is a computer programming concept applicable to multi-threaded code. Thread-safe code only manipulates shared data structures in a manner that ensures that all threads behave properly and fulfill their design specifications without uni ...
'' than mutable objects.


Violating immutability

Immutability does not imply that the object as stored in the computer's
memory Memory is the faculty of the mind by which data or information is encoded, stored, and retrieved when needed. It is the retention of information over time for the purpose of influencing future action. If past events could not be remembered ...
is unwriteable. Rather, immutability is a
compile-time In computer science, compile time (or compile-time) describes the time window during which a computer program is compiled. The term is used as an adjective to describe concepts related to the context of program compilation, as opposed to concept ...
construct that indicates what a programmer can do through the normal interface of the object, not necessarily what they can absolutely do (for instance, by circumventing the type system or violating
const correctness In some programming languages, const is a type qualifier (a keyword applied to a data type) that indicates that the data is read-only. While this can be used to declare constants, in the C family of languages differs from similar constructs i ...
in C or
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
).


Language-specific details

In
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
,
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mos ...
and the
.NET Framework The .NET Framework (pronounced as "''dot net"'') is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows. It was the predominant implementation of the Common Language Infrastructure (CLI) until bein ...
, strings are immutable objects. Both Java and the .NET Framework have mutable versions of string. In Java these are
StringBuffer In computer programming, a string is traditionally a sequence of characters, either as a literal constant or as some kind of variable. The latter may allow its elements to be mutated and the length changed, or it may be fixed (after creation). ...
and StringBuilder (mutable versions of Java ) and in .NET this is StringBuilder
/code> (mutable version of .Net String
/code>).
Python 3 The programming language Python was conceived in the late 1980s, and its implementation was started in December 1989 by Guido van Rossum at CWI in the Netherlands as a successor to ABC capable of exception handling and interfacing with th ...
has a mutable string (bytes) variant, named bytearray. Additionally, all of the
primitive wrapper class In object-oriented programming, a wrapper class is a class (computer programming), class that Encapsulation (computer programming), encapsulates data type, types, so that those types can be used to create object (computer science), object instance ( ...
es in Java are immutable. Similar patterns are the Immutable Interface and Immutable Wrapper. In pure
functional programming In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions that ...
languages it is not possible to create mutable objects without extending the language (e.g. via a mutable references library or a
foreign function interface A foreign function interface (FFI) is a mechanism by which a program written in one programming language can call routines or make use of services written in another. Naming The term comes from the specification for Common Lisp, which explicit ...
), so all objects are immutable.


Ada

In
Ada Ada may refer to: Places Africa * Ada Foah, a town in Ghana * Ada (Ghana parliament constituency) * Ada, Osun, a town in Nigeria Asia * Ada, Urmia, a village in West Azerbaijan Province, Iran * Ada, Karaman, a village in Karaman Province, ...
, any object is declared either ''variable'' (i.e. mutable; typically the implicit default), or constant (i.e. immutable) via the constant keyword. type Some_type is new Integer; -- could be anything more complicated x: constant Some_type:= 1; -- immutable y: Some_type; -- mutable Subprogram parameters are immutable in the ''in'' mode, and mutable in the ''in out'' and ''out'' modes. procedure Do_it(a: in Integer; b: in out Integer; c: out Integer) is begin -- a is immutable b:= b + a; c:= a; end Do_it;


C#

In C# you can enforce immutability of the fields of a class with the readonly statement. By enforcing all the fields as immutable, you obtain an immutable type. class AnImmutableType


C++

In C++, a const-correct implementation of Cart would allow the user to create instances of the class and then use them as either const (immutable) or mutable, as desired, by providing two different versions of the items() method. (Notice that in C++ it is not necessary — and in fact impossible — to provide a specialized constructor for const instances.) class Cart ; Note that, when there is a data member that is a pointer or reference to another object, then it is possible to mutate the object pointed to or referenced only within a non-const method. C++ also provides abstract (as opposed to bitwise) immutability via the mutable keyword, which lets a
member variable In object-oriented programming, a member variable (sometimes called a member field) is a variable that is associated with a specific object, and accessible for all its methods (''member functions''). In class-based programming languages, these ...
be changed from within a const method. class Cart ;


D

In D, there exist two
type qualifier In the C, C++, and D programming languages, a type qualifier is a keyword that is applied to a type, resulting in a ''qualified type.'' For example, const int is a qualified type representing a constant integer, while int is the corresponding u ...
s, const and immutable, for variables that cannot be changed.D Language Specification § 18
/ref> Unlike C++'s const, Java's final, and C#'s readonly, they are transitive and recursively apply to anything reachable through references of such a variable. The difference between const and immutable is what they apply to: const is a property of the variable: there might legally exist mutable references to referred value, i.e. the value can actually change. In contrast, immutable is a property of the referred value: the value and anything transitively reachable from it cannot change (without breaking the type system, leading to
undefined behavior In computer programming, undefined behavior (UB) is the result of executing a program whose behavior is prescribed to be unpredictable, in the language specification to which the computer code adheres. This is different from unspecified behavior ...
). Any reference of that value must be marked const or immutable. Basically for any unqualified type T, const(T) is the disjoint union of T (mutable) and immutable(T). class C For a mutable C object, its mField can be written to. For a const(C) object, mField cannot be modified, it inherits const; iField is still immutable as it is the stronger guarantee. For an immutable(C), all fields are immutable. In a function like this: void func(C m, const C c, immutable C i) Inside the braces, c might refer to the same object as m, so mutations to m could indirectly change c as well. Also, c might refer to the same object as i, but since the value then is immutable, there are no changes. However, m and i cannot legally refer to the same object. In the language of guarantees, mutable has no guarantees (the function might change the object), const is an outward-only guarantee that the function will not change anything, and immutable is a bidirectional guarantee (the function will not change the value and the caller must not change it). Values that are const or immutable must be initialized by direct assignment at the point of
declaration Declaration may refer to: Arts, entertainment, and media Literature * ''Declaration'' (book), a self-published electronic pamphlet by Michael Hardt and Antonio Negri * ''The Declaration'' (novel), a 2008 children's novel by Gemma Malley Music ...
or by a constructor. Because const parameters forget if the value was mutable or not, a similar construct, inout, acts, in a sense, as a variable for mutability information. A function of type const(S) function(const(T)) returns const(S) typed values for mutable, const and immutable arguments. In contrast, a function of type inout(S) function(inout(T)) returns S for mutable T arguments, const(S) for const(T) values, and immutable(S) for immutable(T) values. Casting immutable values to mutable inflicts undefined behavior upon change, even if the original value comes from a mutable origin. Casting mutable values to immutable can be legal when there remain no mutable references afterward. "An expression may be converted from mutable (...) to immutable if the expression is unique and all expressions it transitively refers to are either unique or immutable." If the compiler cannot prove uniqueness, the casting can be done explicitly and it is up to the programmer to ensure that no mutable references exist. The type string is an alias for immutable(char)[], i.e. a typed slice of memory of immutable characters. Making substrings is cheap, as it just copies and modifies a pointer and a length filed, and safe, as the underlying data cannot be changed. Objects of type const(char)[] can refer to strings, but also to mutable buffers. Making a shallow copy of a const or immutable value removes the outer layer of immutability: Copying an immutable string (immutable(char[])) returns a string (immutable(char)[]). The immutable pointer and length are being copied and the copies are mutable. The referred data has not been copied and keeps its qualifier, in the example immutable. It can be stripped by making a depper copy, e.g. using the dup function.


Java

A classic example of an immutable object is an instance of the Java String class String s = "ABC"; s.toLowerCase(); The method toLowerCase() does not change the data "ABC" that s contains. Instead, a new String object is instantiated and given the data "abc" during its construction. A reference to this String object is returned by the toLowerCase() method. To make the String s contain the data "abc", a different approach is needed: s = s.toLowerCase(); Now the String s references a new String object that contains "abc". There is nothing in the syntax of the ''declaration'' of the class String that enforces it as immutable; rather, none of the String class's methods ever affect the data that a String object contains, thus making it immutable. The keyword final ( detailed article) is used in implementing immutable primitive types and object references, but it cannot, by itself, make ''the objects themselves'' immutable. See below examples: Primitive type variables (int, long, short, etc.) can be reassigned after being defined. This can be prevented by using final. int i = 42; //int is a primitive type i = 43; // OK final int j = 42; j = 43; // does not compile. j is final so can't be reassigned Reference types cannot be made immutable just by using the final keyword. final only prevents reassignment. final MyObject m = new MyObject(); //m is of reference type m.data = 100; // OK. We can change state of object m (m is mutable and final doesn't change this fact) m = new MyObject(); // does not compile. m is final so can't be reassigned Primitive wrappers (Integer, Long, Short, Double, Float, Character, Byte, Boolean) are also all immutable. Immutable classes can be implemented by following a few simple guidelines.


JavaScript

In
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, of ...
, all primitive types (Undefined, Null, Boolean, Number, BigInt, String, Symbol) are immutable, but custom objects are generally mutable. function doSomething(x) ; var str = 'a string'; var obj = ; doSomething(str); // strings, numbers and bool types are immutable, function gets a copy doSomething(obj); // objects are passed in by reference and are mutable inside function doAnotherThing(str, obj); // `str` has not changed, but `obj` may have. To simulate immutability in an object, one may define properties as read-only (writable: false). var obj = ; Object.defineProperty(obj, 'foo', ); obj.foo = 'bar2'; // silently ignored However, the approach above still lets new properties be added. Alternatively, one may us
Object.freeze
to make existing objects immutable. var obj = ; Object.freeze(obj); obj.foo = 'bars'; // cannot edit property, silently ignored obj.foo2 = 'bar2'; // cannot add property, silently ignored With the implementation o
ECMA262
JavaScript has the ability to create immutable references that cannot be reassigned. However, using a const declaration doesn't mean that value of the read-only reference is immutable, just that the name cannot be assigned to a new value. const ALWAYS_IMMUTABLE = true; try catch (err) const arr =
, 2, 3 The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baselin ...
arr.push(4); console.log(arr); //
, 2, 3, 4 The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline (t ...
The use of immutable state has become a rising trend in JavaScript since the introduction of React, which favours Flux-like state management patterns such as Redux.


Perl

In
Perl Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it also referred to its redesigned "sister language", Perl 6, before the latter's name was offic ...
, one can create an immutable class with the Moo library by simply declaring all the attributes read only: package Immutable; use Moo; has value => ( is => 'ro', # read only default => 'data', # can be overridden by supplying the constructor with # a value: Immutable->new(value => 'something else'); ); 1; Creating an immutable class used to require two steps: first, creating accessors (either automatically or manually) that prevent modification of object attributes, and secondly, preventing direct modification of the instance data of instances of that class (this was usually stored in a hash reference, and could be locked with Hash::Util's lock_hash function): package Immutable; use strict; use warnings; use base qw(Class::Accessor); # create read-only accessors __PACKAGE__->mk_ro_accessors(qw(value)); use Hash::Util 'lock_hash'; sub new 1; Or, with a manually written accessor: package Immutable; use strict; use warnings; use Hash::Util 'lock_hash'; sub new # read-only accessor sub value 1;


Python

In
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
, some built-in types (numbers, booleans, strings, tuples, frozensets) are immutable, but custom classes are generally mutable. To simulate immutability in a class, one could override attribute setting and deletion to raise exceptions: class ImmutablePoint: """An immutable class with two attributes 'x' and 'y'.""" __slots__ = x', 'y' def __setattr__(self, *args): raise TypeError("Can not modify immutable instance.") __delattr__ = __setattr__ def __init__(self, x, y): # We can no longer use self.value = value to store the instance data # so we must explicitly call the superclass super().__setattr__('x', x) super().__setattr__('y', y) The standard library helper
collections.namedtuple
an

available from Python 3.6 onward, create simple immutable classes. The following example is roughly equivalent to the above, plus some tuple-like features: from typing import NamedTuple import collections Point = collections.namedtuple('Point', x', 'y' # the following creates a similar namedtuple to the above class Point(NamedTuple): x: int y: int Introduced in Python 3.7
dataclasses
allow developers to emulate immutability wit

If a frozen dataclass is built, dataclasses will override __setattr__() and __delattr__() to raise FrozenInstanceError if invoked. from dataclasses import dataclass @dataclass(frozen=True) class Point: x: int y: int


Racket

Racket substantially diverges from other Scheme implementations by making its core pair type ("cons cells") immutable. Instead, it provides a parallel mutable pair type, via mcons, mcar, set-mcar! etc. In addition, many immutable types are supported, for example, immutable strings and vectors, and these are used extensively. New structs are immutable by default, unless a field is specifically declared mutable, or the whole struct: (struct foo1 (x y)) ; all fields immutable (struct foo2 (x #:mutable) ; one mutable field (struct foo3 (x y) #:mutable) ; all fields mutable The language also supports immutable hash tables, implemented functionally, and immutable dictionaries.


Rust

Rust's ownership system allows developers to declare immutable variables, and pass immutable references. By default, all variables and references are immutable. Mutable variables and references are explicitly created with the mut keyword.
Constant items
in Rust are always immutable. // constant items are always immutable const ALWAYS_IMMUTABLE: bool = true; struct Object fn main()


Scala

In Scala, any entity (narrowly, a binding) can be defined as mutable or immutable: in the declaration, one can use val (value) for immutable entities and var (variable) for mutable ones. Note that even though an immutable binding can not be reassigned, it may still refer to a mutable object and it is still possible to call mutating methods on that object: the ''binding'' is immutable, but the underlying ''object'' may be mutable. For example, the following code snippet: val maxValue = 100 var currentValue = 1 defines an immutable entity maxValue (the integer type is inferred at compile-time) and a mutable entity named currentValue. By default, collection classes such as List and Map are immutable, so update-methods return a new instance rather than mutating an existing one. While this may sound inefficient, the implementation of these classes and their guarantees of immutability mean that the new instance can re-use existing nodes, which, especially in the case of creating copies, is very efficient.


See also

*
Clojure Clojure (, like ''closure'') is a dynamic and functional dialect of the Lisp programming language on the Java platform. Like other Lisp dialects, Clojure treats code as data and has a Lisp macro system. The current development process is comm ...
* Erlang * F# *
Haskell Haskell () is a general-purpose, statically-typed, purely functional programming language with type inference and lazy evaluation. Designed for teaching, research and industrial applications, Haskell has pioneered a number of programming lan ...
*
Mutator method In computer science, a mutator method is a method used to control changes to a variable. They are also widely known as setter methods. Often a setter is accompanied by a getter (together also known as accessors), which returns the value of the priva ...
*
Prolog Prolog is a logic programming language associated with artificial intelligence and computational linguistics. Prolog has its roots in first-order logic, a formal logic, and unlike many other programming languages, Prolog is intended primarily ...
* Scala *
Tcl TCL or Tcl or TCLs may refer to: Business * TCL Technology, a Chinese consumer electronics and appliance company **TCL Electronics, a subsidiary of TCL Technology * Texas Collegiate League, a collegiate baseball league * Trade Centre Limited ...


References

''This article contains some material from the Perl Design Patterns Book''


External links

{{Wiktionary, mutable
Immutable objects in C#
using 3 simple steps. * Articl

by
Brian Goetz Brian (sometimes spelled Bryan in English) is a male given name of Irish and Breton origin, as well as a surname of Occitan origin. It is common in the English-speaking world. It is possible that the name is derived from an Old Celtic word mea ...
, from
IBM DeveloperWorks IBM Developer is a global community of coders, developer advocates, and digital resources that help developers learn, build, and connect. The IBM Developer website (previously known as IBM developerWorks) hosts a wide range of resources, tools, a ...
â€
saved copy at Internet Archive
by
Brian Goetz Brian (sometimes spelled Bryan in English) is a male given name of Irish and Breton origin, as well as a surname of Occitan origin. It is common in the English-speaking world. It is possible that the name is derived from an Old Celtic word mea ...
, from
IBM DeveloperWorks IBM Developer is a global community of coders, developer advocates, and digital resources that help developers learn, build, and connect. The IBM Developer website (previously known as IBM developerWorks) hosts a wide range of resources, tools, a ...
â€
saved copy at Internet Archive

Immutable objects
from JavaPractices.com
Immutable objects
from
Portland Pattern Repository The Portland Pattern Repository (PPR) is a repository for computer programming software design patterns. It was accompanied by a companion website, WikiWikiWeb, which was the world's first wiki. The repository has an emphasis on Extreme Programmin ...

Immutable.js
by Facebook
Immutable structures in C#
opensource project in Codeplex
Immutable collections in .NET
official library by Microsoft
Immutable objects in C#
by Tutlane.com Object (computer science) Functional programming Articles with example C++ code Articles with example Java code Articles with example Perl code Articles with example Python (programming language) code Articles with example Racket code Functional data structures