Referencing environment and scope

倾然丶 夕夏残阳落幕 提交于 2019-12-11 00:35:21

问题


In any programming language, is the type of referencing environment dependent on the scoping? i.e. a static scoped language would necessarily have static referencing environment?


回答1:


Yes. The referencing environment is the collection of variables which can be used. In a static scoped language, you can only reference the variables in the static reference environment.

A function in a static scoped language does have dynamic ancestors (i.e. its callers), but it can not reference any variables declared in that ancestor.



来源:https://stackoverflow.com/questions/3043481/referencing-environment-and-scope

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!