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

MutableHashTable -- the class of all mutable hash tables

Description

A mutable hash table is a type of hash table whose entries can be changed.

Normally the entries in a mutable hash table are not printed, to prevent infinite loops in the printing routines. To print them out, use peek.
i1 : x = new MutableHashTable

o1 = MutableHashTable{}

o1 : MutableHashTable
i2 : scan(0 .. 30, i -> x#i = i^2)
i3 : x # 20

o3 = 400
i4 : x #? 40

o4 = false

See also

Menu

Types of mutable hash table:

Methods that use a mutable hash table:

  • addHook(MutableHashTable,Thing,Function) -- see addHook -- add a hook function to an object for later processing
  • runHooks(MutableHashTable,Thing,Thing) -- see runHooks -- run the hook functions stored in an object

For the programmer

The object MutableHashTable is a type, with ancestor classes HashTable < Thing.


The source of this document is in Macaulay2Doc/ov_hashtables.m2:140:0.