Parameters
Parameters are essentially a derived concept in Scheme; they are defined in terms of continuation marks and thread cells. However,
parameters are also built in, in the sense that some primitive procedures consult parameter values. For example, the default output
stream for primitive output operations is determined by a parameter.
A parameter is a setting that is both thread-specific and continuation-specific. In the empty continuation, each parameter corresponds
to a preserved thread cell; a corresponding parameter procedure accesses and sets the thread cell's value for the current thread.
In a non-empty continuation, a parameter's value is determined through a parameterization that is associated with the nearest enclosing
continuation frame though a continuation mark (whose key is not directly accessible). A parameterization maps each parameter to a preserved
thread cell, and the combination of thread cell and current thread yields the parameter's value. A parameter procedure sets or accesses
the relevant thread cell for its parameter.
Various operations, such as parameterize or call-with-parameterization, install a parameterization into the current continuation's frame.
July 8th Wednesday (七月 八日 水曜日)
最新推荐文章于 2025-08-21 09:06:15 发布
本文深入探讨了Scheme语言中参数的概念及其工作原理。参数在Scheme中既是线程特定的也是延续特定的,通过延续标记和线程单元定义。文章解释了如何通过参数过程访问和设置当前线程中的线程单元值,并在非空延续中通过延续标记确定参数值。
1335

被折叠的 条评论
为什么被折叠?



