July 8th Wednesday (七月 八日 水曜日)

时间:2021-12-08 16:27:38

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.