# remove -- remove an entry from a mutable hash table

• Usage:
remove(T, k)
• Inputs:
• T, ,
• k, key
• Outputs:

## Description

remove(T, k) removes the entry of T stored under the key k.

 i1 : T = new MutableHashTable from {a => 1, b => 2, c => 3}; peek T o2 = MutableHashTable{a => 1} b => 2 c => 3 i3 : remove(T, a) i4 : peek T o4 = MutableHashTable{b => 2} c => 3

If T is not a mutable hash table, an error is thrown. One way to remove an entry from an immutable hash table is with the function applyPairs:

 i5 : T = new HashTable from {a => 1, b => 2, c => 3} o5 = HashTable{a => 1} b => 2 c => 3 o5 : HashTable i6 : T = applyPairs(T, (k, v) -> if k =!= a then (k, v)) o6 = HashTable{b => 2} c => 3 o6 : HashTable

The remove command does not return any output.

• applyKeys -- apply a function to each key in a hash table
• applyPairs -- apply a function to each pair in a hash table
• applyValues -- apply a function to each value in a hash table
• delete -- delete some elements of a list
• drop -- drop some elements from a list or sequence.
• keys -- keys used in a hash table, dictionary, or database
• mutable -- whether something may be modified
• scanKeys -- apply a function to each key in a hash table or database
• hash tables

## Ways to use remove :

• "remove(HashTable,Thing)"

## For the programmer

The object remove is .