Clean up the list of environments matching a memory address in an environment map.
clean_up_matching_environments(envmap, indfound)
data frame with the name-address pairs of environments having at least a column called "type" that specifies the type of environment, for which "function" is used to indicate a function execution environment.
array containing the indices in envmap giving the environments to clean up (typically these are the environments that match a given memory address).
an array containing the indices in indfound
after cleanup.
A clean list of matched environments from envmap
should either:
contain ONLY ONE function execution environment,
contain one ore more user or named environments.
If none of the above is the case, all function execution environments are removed from the list
of matching environments, i.e. removed from the indfound
array.