引用环境和范围 [英] Referencing environment and scope

查看:44
本文介绍了引用环境和范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在任何编程语言中,引用环境的类型是否取决于范围?即静态作用域语言必然具有静态引用环境?

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?

推荐答案

是的.引用环境是可以使用的变量的集合.在静态作用域语言中,您只能引用静态引用环境中的变量.

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.

这篇关于引用环境和范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆