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

📄 unit-library.html

📁 Scheme跨平台编译器
💻 HTML
📖 第 1 页 / 共 3 页
字号:
intelunknown</pre><a name="chicken-version"></a><h3>chicken-version</h3><pre>[procedure] (chicken-version [FULL])</pre><p>Returns a string containing the version number of the CHICKEN runtime system. If the optional argument <tt>FULL</tt> is given and true, then a full version string is returned.</p><a name="errno"></a><h3>errno</h3><pre>[procedure] (errno)</pre><p>Returns the error code of the last system call.</p><a name="getenv"></a><h3>getenv</h3><pre>[procedure] (getenv STRING)</pre><p>Returns the value of the environment variable <tt>STRING</tt> or <tt>#f</tt> if that variable is not defined.</p><a name="machine-byte-order"></a><h3>machine-byte-order</h3><pre>[procedure] (machine-byte-order)</pre><p>Returns the symbol <tt>little-endian</tt> or <tt>big-endian</tt>, depending on the machine's byte-order.</p><a name="machine-type"></a><h3>machine-type</h3><pre>[procedure] (machine-type)</pre><p>Returns a symbol specifying the processor on which this process is currently running, which is one of the following:</p><pre>alphamipshppaultrasparcsparcppcppc64ia64x86x86-64unknown</pre><a name="on-exit"></a><h3>on-exit</h3><pre>[procedure] (on-exit THUNK)</pre><p>Schedules the zero-argument procedures <tt>THUNK</tt> to be executed before the process exits, either explicitly via <tt>exit</tt> or implicitly after execution of the last top-level form. Note that finalizers for unreferenced finalized data are run before exit procedures.</p><a name="software-type"></a><h3>software-type</h3><pre>[procedure] (software-type)</pre><p>Returns a symbol specifying the operating system on which this process is currently running, which is one of the following:</p><pre>windowsunixmacosecosunknown</pre><a name="software-version"></a><h3>software-version</h3><pre>[procedure] (software-version)</pre><p>Returns a symbol specifying the operating system version on which this process is currently running, which is one of the following:</p><pre>linuxfreebsdnetbsdopenbsdmacosxhpuxsolarissunosunknown</pre><a name="c-runtime"></a><h3>c-runtime</h3><pre>[procedure] (c-runtime)</pre><p>Returns a symbol that designates what kind of C runtime library has been linked with this version of the Chicken libraries. Possible return values are <tt>static</tt>, <tt>dynamic</tt> or <tt>unknown</tt>. On systems not compiled with the Microsoft C compiler, <tt>c-runtime</tt> always returns <tt>unknown</tt>.</p><a name="system"></a><h3>system</h3><pre>[procedure] (system STRING)</pre><p>Execute shell command. The functionality offered by this procedure depends on the capabilities of the host shell. If the forking of a subprocess failed, an exception is raised. Otherwise the return status of the subprocess is returned unaltered.</p><a name="execution-time"></a><h2>Execution time</h2><a name="cpu-time"></a><h3>cpu-time</h3><pre>[procedure] (cpu-time)</pre><p>Returns the used CPU time of the current process in milliseconds as two values: the time spent in user code, and the time spent in system code. On platforms where user and system time can not be differentiated, system time will be always be 0.</p><a name="current-milliseconds"></a><h3>current-milliseconds</h3><pre>[procedure] (current-milliseconds)</pre><p>Returns the number of milliseconds since process- or machine startup.</p><a name="current-seconds"></a><h3>current-seconds</h3><pre>[procedure] (current-seconds)</pre><p>Returns the number of seconds since midnight, Jan. 1, 1970.</p><a name="current-gc-milliseconds"></a><h3>current-gc-milliseconds</h3><pre>[procedure] (current-gc-milliseconds)</pre><p>Returns the number of milliseconds spent in major garbage collections since the last call of <tt>current-gc-milliseconds</tt> and returns an exact integer.</p><a name="interrupts-and-error-handling"></a><h2>Interrupts and error-handling</h2><a name="enable-warnings"></a><h3>enable-warnings</h3><pre>[procedure] (enable-warnings [BOOL])</pre><p>Enables or disables warnings, depending on wether <tt>BOOL</tt> is true or false. If called with no arguments, this procedure returns <tt>#t</tt> if warnings are currently enabled, or <tt>#f</tt> otherwise. Note that this is not a parameter. The current state (whether warnings are enabled or disabled) is global and not thread-local.</p><a name="error"></a><h3>error</h3><pre>[procedure] (error [LOCATION] [STRING] EXP ...)</pre><p>Prints error message, writes all extra arguments to the value of <tt>(current-error-port)</tt> and invokes the current exception-handler. This conforms to <a href="http://srfi.schemers.org/srfi-23/srfi-23.html" class="external">SRFI-23</a>. If <tt>LOCATION</tt> is given and a symbol, it specifies the <em>location</em> (the name of the procedure) where the error occurred.</p><a name="get-call-chain"></a><h3>get-call-chain</h3><pre>[procedure] (get-call-chain [START [THREAD]])</pre><p>Returns a list with the call history. Backtrace information is only generated in code compiled without <tt>-no-trace</tt> and evaluated code. If the optional argument <tt>START</tt> is given, the backtrace starts at this offset, i.e. when <tt>START</tt> is 1, the next to last trace-entry is printed, and so on. If the optional argument <tt>THREAD</tt> is given, then the call-chain will only be constructed for calls performed by this thread.</p><a name="print-call-chain"></a><h3>print-call-chain</h3><pre>[procedure] (print-call-chain [PORT [START [THREAD]]])</pre><p>Prints a backtrace of the procedure call history to <tt>PORT</tt>, which defaults to <tt>(current-output-port)</tt>.</p><a name="print-error-message"></a><h3>print-error-message</h3><pre>[procedure] (print-error-message EXN [PORT [STRING]])</pre><p>Prints an appropriate error message to <tt>PORT</tt> (which defaults to the value of <tt>(current-output-port)</tt> for the object <tt>EXN</tt>. <tt>EXN</tt> may be a condition, a string or any other object. If the optional argument <tt>STRING</tt> is given, it is printed before the error-message. <tt>STRING</tt> defaults to <tt>"Error:"</tt>.</p><a name="procedure-information"></a><h3>procedure-information</h3><pre>[procedure] (procedure-information PROC)</pre><p>Returns an s-expression with debug information for the procedure <tt>PROC</tt>, or <tt>#f</tt>, if <tt>PROC</tt> has no associated debug information.</p><a name="reset"></a><h3>reset</h3><pre>[procedure] (reset)</pre><p>Reset program (Invokes <tt>reset-handler</tt>).</p><a name="warning"></a><h3>warning</h3><pre>[procedure] (warning STRING EXP ...)</pre><p>Displays a warning message (if warnings are enabled with <tt>enable-warnings</tt>) and continues execution.</p><a name="singlestep"></a><h3>singlestep</h3><pre>[procedure] (singlestep THUNK)</pre><p>Executes the code in the zero-procedure <tt>THUNK</tt> in single-stepping mode.</p><a name="garbage-collection"></a><h2>Garbage collection</h2><a name="gc"></a><h3>gc</h3><pre>[procedure] (gc [FLAG])</pre><p>Invokes a garbage-collection and returns the number of free bytes in the heap. The flag specifies whether a minor (<tt>#f</tt>) or major (<tt>#t</tt>) GC is to be triggered. If no argument is given, <tt>#t</tt> is assumed. An explicit <tt>#t</tt> argument will cause all pending finalizers to be executed.</p><a name="memory-statistics"></a><h3>memory-statistics</h3><pre>[procedure] (memory-statistics)</pre><p>Performs a major garbage collection and returns a three element vector containing the total heap size in bytes, the number of bytes currently used and the size of the nursery (the first heap generation). Note that the actual heap is actually twice the size given in the heap size, because CHICKEN uses a copying semi-space collector.</p><a name="set-finalizer"></a><h3>set-finalizer!</h3><pre>[procedure] (set-finalizer! X PROC)</pre><p>Registers a procedure of one argument <tt>PROC</tt>, that will be called as soon as the non-immediate data object <tt>X</tt> is about to be garbage-collected (with that object as its argument). Note that the finalizer will <strong>not</strong> be called while interrupts are disabled. This procedure returns <tt>X</tt>.</p><p>Finalizers are invoked asynchronously, in the thread that happens to be currently running.</p><a name="set-gc-report"></a><h3>set-gc-report!</h3><pre>[procedure] (set-gc-report! FLAG)</pre><p>Print statistics after every GC, depending on <tt>FLAG</tt>. A value of <tt>#t</tt> shows statistics after every major GC. A true value different from <tt>#t</tt> shows statistics after every minor GC. <tt>#f</tt> switches statistics off.</p><a name="other-control-structures"></a><h2>Other control structures</h2><a name="promise"></a><h3>promise?</h3><pre>[procedure] (promise? X)</pre><p>Returns <tt>#t</tt> if <tt>X</tt> is a promise returned by <tt>delay</tt>, or <tt>#f</tt> otherwise.</p><a name="string-utilities"></a><h2>String utilities</h2><a name="reverse-list-string"></a><h3>reverse-list&rarr;string</h3><pre>[procedure] (reverse-list-&gt;string LIST)</pre><p>Returns a string with the characters in <tt>LIST</tt> in reverse order. This is equivalent to <tt>(list-&gt;string (reverse LIST))</tt>, but much more efficient.</p><a name="generating-uninterned-symbols"></a><h2>Generating uninterned symbols</h2><a name="gensym"></a><h3>gensym</h3><pre>[procedure] (gensym [STRING-OR-SYMBOL])</pre><p>Returns a newly created uninterned symbol. If an argument is provided, the new symbol is prefixed with that argument.</p><a name="string-uninterned-symbol"></a><h3>string&rarr;uninterned-symbol</h3><pre>[procedure] (string-&gt;uninterned-symbol STRING)</pre><p>Returns a newly created, unique symbol with the name <tt>STRING</tt>.</p><a name="standard-input-output"></a><h2>Standard Input/Output</h2><a name="port"></a><h3>port?</h3><pre>[procedure] (port? X)</pre><p>Returns <tt>#t</tt> if <tt>X</tt> is a port object or <tt>#f</tt> otherwise.</p><a name="print"></a><h3>print</h3><pre>[procedure] (print [EXP1 ...])</pre><p>Outputs the optional arguments <tt>EXP1 ...</tt> using <tt>display</tt> and writes a newline character to the port that is the value of <tt>(current-output-port)</tt>. Returns <tt>(void)</tt>.</p><a name="print"></a><h3>print*</h3><pre>[procedure] (print* [EXP1 ...])</pre><p>Similar to <tt>print</tt>, but does not output a terminating newline character and performs a <tt>flush-output</tt> after writing its arguments.</p><a name="user-defined-named-characters"></a><h2>User-defined named characters</h2><a name="char-name"></a><h3>char-name</h3><pre>[procedure] (char-name SYMBOL-OR-CHAR [CHAR])</pre><p>This procedure can be used to inquire about character names or to define new ones. With a single argument the behavior is as follows: If <tt>SYMBOL-OR-CHAR</tt> is a symbol, then <tt>char-name</tt> returns the character with this name, or <tt>#f</tt> if no character is defined under this name. If <tt>SYMBOL-OR-CHAR</tt> is a character, then the name of the character is returned as a symbol, or <tt>#f</tt> if the character has no associated name.</p><p>If the optional argument <tt>CHAR</tt> is provided, then <tt>SYMBOL-OR-CHAR</tt> should be a symbol that will be the new name of the given character. If multiple names designate the same character, then the <tt>write</tt> will use the character name that was defined last.</p><PRE>(char-name 'space)                  =<B><FONT COLOR="#A020F0">=&gt;</FONT></B> #\space(char-name #\space)                 =<B><FONT COLOR="#A020F0">=&gt;</FONT></B> space(char-name 'bell)                   =<B><FONT COLOR="#A020F0">=&gt;</FONT></B> #f(char-name (integer-&gt;char 7))       =<B><FONT COLOR="#A020F0">=&gt;</FONT></B> #f

⌨️ 快捷键说明

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