Staged map for implementing the Environment. The idea is to store imported entries into a hashtable and local entries into a persistent hashtable.
- The number of entries (i.e., declarations) coming from imported files is much bigger than the number of entries in the current file.
- HashMap is faster than PersistentHashMap.
- When we are reading imported files, we have exclusive access to the map, and efficient destructive updates are performed.
- We never remove declarations from the Environment. In principle, we could support
deletion by using
(PHashMap α (Option β))where the value
nonewould indicate that an entry was "removed" from the hashtable.
- We do not need additional bookkeeping for extracting the local entries.