
  -spec put(Key, Val) -> term() when Key :: term(), Val :: term().

  Adds a new Key to the process dictionary, associated with the
  value Val, and returns undefined. If Key exists, the old
  value is deleted and replaced by Val, and the function returns
  the old value. The average time complexity for the current
  implementation of this function is O(1) and the worst case time
  complexity is O(N), where N is the number of items in the
  process dictionary. Example:

    > X = put(name, walrus), Y = put(name, carpenter),
    Z = get(name),
    {X, Y, Z}.
    {undefined,walrus,carpenter}

  Note:
    The values stored when put is evaluated within the scope of
    a catch are not retracted if a throw is evaluated, or if
    an error occurs.
