ecl-logo Documentation

ClearMemoization

ClearMemoization[function]

clears memoized values for the function.

ClearMemoization[]

clears memoization from functions that were added to $Memoization.

Details

  • $Memoization is populated every time function known to have memoization is run. Detection of those functions is not automatic and developers have to add AppendTo[$Memoization, function] in their code. Once ClearMemoization[] is run, memoizations for all known functions should be cleared.
  • Input

Examples

Basic Examples  (3)

DownValues for memoized function are being cleared leaving the correct definition intact:

DownValues for memoized function are being cleared leaving the correct definition intact when called with no inputs:

When the same function has several memoized inputs, clears all of them: