当前位置:在线查询网 > 在线百科全书查询 > 词法域

词法域_在线百科全书查询


请输入要查询的词条内容:

词法域


英文名

Lexical Scoping

Lexical Scoping(sometimes called static) is the method used to define the scope andextent of variables in Scheme, Common Lisp, Pascal and Algol. Lexicalscoping requires keeping track of the lexical order as well as thedynamic execution order at runtime. This means that a Scheme procedurecall will of necessity be more expensive than a similar call in C orFortran

解析:

词法域是一种用来定义在Scheme,CommonLisp,Pascal,Algol中环境及外部变量的方法,词法域不仅需要跟踪程序的语法顺序,并且也要遵循程序运行时的执行顺序来完成。这表明Scheme的过程调用比C或者Fortran这类面向对象程序要求更加多的资源需求。

词法域是块结构的更进一步,如果嵌套过程中的参数如果外部过程已经定义过了(从外面过程传递进来),对于该嵌套过程,可以省略参数,但是过程内部仍然可以使用外部过程定义过的参数。这种块结构称为词法域。

相关阅读:

Dynamic Scoping

动态作用域

相关分词: 词法