next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Macaulay2Doc > The Macaulay2 language > hash tables > mutable

mutable -- whether something may be modified



If x is a hash table, list, dictionary, or database, then it is mutable if its contents can be destructively altered.

If x is a symbol, then it's mutable if a value can be assigned to it; i.e., if it is not protected.

If x is anything else, mutable x will return false.

i1 : T = new MutableList from (a, b, c)

o1 = MutableList{...3...}

o1 : MutableList
i2 : mutable T

o2 = true
i3 : V = new List from (a, b, c)

o3 = {a, b, c}

o3 : List
i4 : mutable V

o4 = false
i5 : mutable join(T, V)

o5 = true
i6 : mutable a

o6 = true
i7 : mutable "a"

o7 = false


The (changeable) contents of a mutable hash table or list do not participate in strong comparison with === or in hashing.

See also

Ways to use mutable :

For the programmer

The object mutable is a compiled function.