How are environments, (en)closures, and frames related?
问题 I want to better understand how environments, closures, and frames are related. I understand function closures contain an environment, environments contain a frame and an enclosure, and frames contain variables, but I'm a bit fuzzy on how they interact with one another. Perhaps an example of what's going on during a function call would help? Or maybe a diagram? 回答1: UPDATE R-lang defines an environment as having a frame . I tend to think about frames as stack frames , not as mapping from name