Macaulay2 » Documentation
Packages » Macaulay2Doc > The Macaulay2 language > hash tables > isMutable
next | previous | forward | backward | up | index | toc

isMutable -- whether something may be modified

Synopsis

Description

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, isMutable x will return false.

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

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

o1 : MutableList
i2 : isMutable T

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

o3 = {a, b, c}

o3 : List
i4 : isMutable V

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

o5 = true
i6 : isMutable a

o6 = true
i7 : isMutable "a"

o7 = false

This function may also be called using the synonym mutable.

Caveat

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 isMutable :

For the programmer

The object isMutable is a compiled function.