⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 parameters.html

📁 Scheme跨平台编译器
💻 HTML
字号:
<html><head><title>CHICKEN User's Manual - Parameters</title></head><body><p> </p><a name="parameters"></a><h1>Parameters</h1><p>Certain behavior of the interpreter and compiled programs can be customized via 'parameters', where a parameter is a procedure of zero or one arguments. To retrieve the value of a parameter call the parameter-procedure with zero arguments. To change the setting of the parameter, call the parameter-procedure with the new value as argument:</p><PRE>(<B><FONT COLOR="#A020F0">define</FONT></B> <B><FONT COLOR="#0000FF">foo</FONT></B> (make-parameter 123))(foo)                             =<B><FONT COLOR="#A020F0">=&gt;</FONT></B> 123(foo 99)(foo)                             =<B><FONT COLOR="#A020F0">=&gt;</FONT></B> 99</PRE><p>Parameters are fully thread-local, each thread of execution owns a local copy of a parameters' value.</p><p>CHICKEN implements <a href="http://srfi.schemers.org/srfi-39/srfi-39.html" class="external">SRFI-39</a>.</p><a name="make-parameter"></a><h2>make-parameter</h2><pre>[procedure] (make-parameter VALUE [GUARD])</pre><p>Returns a procedure that accepts zero or one argument. Invoking the procedure with zero arguments returns <tt>VALUE</tt>. Invoking the procedure with one argument changes its value to the value of that argument (subsequent invocations with zero parameters return the new value). <tt>GUARD</tt> should be a procedure of a single argument. Any new values of the parameter (even the initial value) are passed to this procedure. The guard procedure should check the value and/or convert it to an appropriate form.</p><a name="case-sensitive"></a><h2>case-sensitive</h2><p>If true, then <tt>read</tt> reads symbols and identifiers in case-sensitive mode and uppercase characters in symbols are printed escaped. Defaults to <tt>#t</tt>.</p><a name="dynamic-load-libraries"></a><h2>dynamic-load-libraries</h2><p>A list of strings containing shared libraries that should be checked for explicitly loaded library units (this facility is not available on all platforms). See <tt>load-library</tt>.</p><a name="command-line-arguments"></a><h2>command-line-arguments</h2><p>Contains the list of arguments passed to this program, with the name of the program and any runtime options (all options starting with <tt>-:</tt>) removed.</p><a name="current-read-table"></a><h2>current-read-table</h2><p>A read-table object that holds read-procedures for special non-standard read-syntax (see <tt>set-read-syntax!</tt> for more information).</p><a name="exit-handler"></a><h2>exit-handler</h2><p>A procedure of a single optional argument. When <tt>exit</tt> is called, then this procedure will be invoked with the exit-code as argument. The default behavior is to terminate the program.</p><a name="eval-handler"></a><h2>eval-handler</h2><p>A procedure of one or two arguments. When <tt>eval</tt> is invoked, it calls the value of this parameter with the same arguments. The default behavior is to evaluate the argument expression and to ignore the second parameter.</p><a name="force-finalizers"></a><h2>force-finalizers</h2><p>If true, force and execute all pending finalizers before exiting the program (either explicitly by <tt>exit</tt> or implicitly when the last toplevel expression has been executed). Default is <tt>#t</tt>.</p><a name="implicit-exit-handler"></a><h2>implicit-exit-handler</h2><p>A procedure of no arguments. When the last toplevel expression of the program has executed, then the value of this parameter is called. The default behaviour is to invoke all pending finalizers.</p><a name="keyword-style"></a><h2>keyword-style</h2><p>Enables alternative keyword syntax, where <tt>STYLE</tt> may be either <tt>#:prefix</tt> (as in Common Lisp) or <tt>#:suffix</tt> (as in DSSSL). Any other value disables the alternative syntaxes.</p><a name="load-verbose"></a><h2>load-verbose</h2><p>A boolean indicating whether loading of source files, compiled code (if available) and compiled libraries should display a message.</p><a name="program-name"></a><h2>program-name</h2><p>The name of the currently executing program. This is equivalent to <tt>(car (argv))</tt> for compiled programs or the filename following the <tt>-script</tt> option in interpreted scripts.</p><a name="repl-prompt"></a><h2>repl-prompt</h2><p>A procedure that should evaluate to a string that will be printed before reading  interactive input from the user in a read-eval-print loop. Defaults to  <tt>(lambda () "#;N&gt; ")</tt>.</p><a name="reset-handler"></a><h2>reset-handler</h2><p>A procedure of zero arguments that is called via <tt>reset</tt>. The default behavior in compiled code is to invoke the value of <tt>(exit-handler)</tt>. The default behavior in the interpreter is to abort the current computation and to restart the read-eval-print loop.</p><p>Previous: <a href="declarations.html" class="internal">Declarations</a></p><p>Next: <a href="unit-library.html" class="internal">Unit library</a></p></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -