📄 guile-procedures.txt
字号:
export-environment-set-signature! - Scheme Procedure: export-environment-set-signature! env signature Change the signature of export environment ENV. eq? - Scheme Procedure: eq? x y Return `#t' iff X references the same object as Y. `eq?' is similar to `eqv?' except that in some cases it is capable of discerning distinctions finer than those detectable by `eqv?'. eqv? - Scheme Procedure: eqv? x y The `eqv?' procedure defines a useful equivalence relation on objects. Briefly, it returns `#t' if X and Y should normally be regarded as the same object. This relation is left slightly open to interpretation, but works for comparing immediate integers, characters, and inexact numbers. equal? - Scheme Procedure: equal? x y Return `#t' iff X and Y are recursively `eqv?' equivalent. `equal?' recursively compares the contents of pairs, vectors, and strings, applying `eqv?' on other objects such as numbers and symbols. A rule of thumb is that objects are generally `equal?' if they print the same. `equal?' may fail to terminate if its arguments are circular data structures. scm-error - Scheme Procedure: scm-error key subr message args data Raise an error with key KEY. SUBR can be a string naming the procedure associated with the error, or `#f'. MESSAGE is the error message string, possibly containing `~S' and `~A' escapes. When an error is reported, these are replaced by formatting the corresponding members of ARGS: `~A' (was `%s' in older versions of Guile) formats using `display' and `~S' (was `%S') formats using `write'. DATA is a list or `#f' depending on KEY: if KEY is `system-error' then it should be a list containing the Unix `errno' value; If KEY is `signal' then it should be a list containing the Unix signal number; otherwise it will usually be `#f'. strerror - Scheme Procedure: strerror err Return the Unix error message corresponding to ERR, which must be an integer value. apply:nconc2last - Scheme Procedure: apply:nconc2last lst Given a list (ARG1 ... ARGS), this function conses the ARG1 ... arguments onto the front of ARGS, and returns the resulting list. Note that ARGS is a list; thus, the argument to this function is a list whose last element is a list. Note: Rather than do new consing, `apply:nconc2last' destroys its argument, so use with care. force - Scheme Procedure: force x If the promise X has not been computed yet, compute and return X, otherwise just return the previously computed value. promise? - Scheme Procedure: promise? obj Return true if OBJ is a promise, i.e. a delayed computation (*note Delayed evaluation: (r5rs.info)Delayed evaluation.). cons-source - Scheme Procedure: cons-source xorig x y Create and return a new pair whose car and cdr are X and Y. Any source properties associated with XORIG are also associated with the new pair. copy-tree - Scheme Procedure: copy-tree obj Recursively copy the data tree that is bound to OBJ, and return a pointer to the new data structure. `copy-tree' recurses down the contents of both pairs and vectors (since both cons cells and vector cells may point to arbitrary objects), and stops recursing when it hits any other object. primitive-eval - Scheme Procedure: primitive-eval exp Evaluate EXP in the top-level environment specified by the current module. eval - Scheme Procedure: eval exp module Evaluate EXP, a list representing a Scheme expression, in the top-level environment specified by MODULE. While EXP is evaluated (using `primitive-eval'), MODULE is made the current module. The current module is reset to its previous value when EVAL returns. eval2 - Scheme Procedure: eval2 obj env_thunk Evaluate EXP, a Scheme expression, in the environment designated by LOOKUP, a symbol-lookup function. Do not use this version of eval, it does not play well with the module system. Use `eval' or `primitive-eval' instead. eval-options-interface - Scheme Procedure: eval-options-interface [setting] Option interface for the evaluation options. Instead of using this procedure directly, use the procedures `eval-enable', `eval-disable', `eval-set!' and `eval-options'. evaluator-traps-interface - Scheme Procedure: evaluator-traps-interface [setting] Option interface for the evaluator trap options. defined? - Scheme Procedure: defined? sym [env] Return `#t' if SYM is defined in the lexical environment ENV. When ENV is not specified, look in the top-level environment as defined by the current module. map-in-order - Scheme Procedure: map-in-order implemented by the C function "scm_map" load-extension - Scheme Procedure: load-extension lib init Load and initialize the extension designated by LIB and INIT. When there is no pre-registered function for LIB/INIT, this is equivalent to (dynamic-call INIT (dynamic-link LIB)) When there is a pre-registered function, that function is called instead. Normally, there is no pre-registered function. This option exists only for situations where dynamic linking is unavailable or unwanted. In that case, you would statically link your program with the desired library, and register its init function right after Guile has been initialized. LIB should be a string denoting a shared library without any file type suffix such as ".so". The suffix is provided automatically. It should also not contain any directory components. Libraries that implement Guile Extensions should be put into the normal locations for shared libraries. We recommend to use the naming convention libguile-bla-blum for a extension related to a module `(bla blum)'. The normal way for a extension to be used is to write a small Scheme file that defines a module, and to load the extension into this module. When the module is auto-loaded, the extension is loaded as well. For example, (define-module (bla blum)) (load-extension "libguile-bla-blum" "bla_init_blum") program-arguments - Scheme Procedure: program-arguments - Scheme Procedure: command-line Return the list of command line arguments passed to Guile, as a list of strings. The list includes the invoked program name, which is usually `"guile"', but excludes switches and parameters for command line options like `-e' and `-l'. make-fluid - Scheme Procedure: make-fluid Return a newly created fluid. Fluids are objects of a certain type (a smob) that can hold one SCM value per dynamic root. That is, modifications to this value are only visible to code that executes within the same dynamic root as the modifying code. When a new dynamic root is constructed, it inherits the values from its parent. Because each thread executes in its own dynamic root, you can use fluids for thread local storage. fluid? - Scheme Procedure: fluid? obj Return `#t' iff OBJ is a fluid; otherwise, return `#f'. fluid-ref - Scheme Procedure: fluid-ref fluid Return the value associated with FLUID in the current dynamic root. If FLUID has not been set, then return `#f'. fluid-set! - Scheme Procedure: fluid-set! fluid value Set the value associated with FLUID in the current dynamic root. with-fluids* - Scheme Procedure: with-fluids* fluids values thunk Set FLUIDS to VALUES temporary, and call THUNK. FLUIDS must be a list of fluids and VALUES must be the same number of their values to be applied. Each substitution is done one after another. THUNK must be a procedure with no argument. setvbuf - Scheme Procedure: setvbuf port mode [size] Set the buffering mode for PORT. MODE can be: `_IONBF' non-buffered `_IOLBF' line buffered `_IOFBF' block buffered, using a newly allocated buffer of SIZE bytes. If SIZE is omitted, a default size will be used. file-port? - Scheme Procedure: file-port? obj Determine whether OBJ is a port that is related to a file. open-file - Scheme Procedure: open-file filename mode Open the file whose name is FILENAME, and return a port representing that file. The attributes of the port are determined by the MODE string. The way in which this is interpreted is similar to C stdio. The first character must be one of the following: `r' Open an existing file for input. `w' Open a file for output, creating it if it doesn't already exist or removing its contents if it does. `a' Open a file for output, creating it if it doesn't already exist. All writes to the port will go to the end of the file. The "append mode" can be turned off while the port is in use *note fcntl: Ports and File Descriptors. The following additional characters can be appended: `+' Open the port for both input and output. E.g., `r+': open an existing file for both input and output. `0' Create an "unbuffered" port. In this case input and output operations are passed directly to the underlying port implementation without additional buffering. This is likely to slow down I/O operations. The buffering mode can be changed while a port is in use *note setvbuf: Ports and File Descriptors. `l' Add line-buffering to the port. The port output buffer will be automatically flushed whenever a newline character is written. In theory we could create read/write ports which were buffered in one direction only. However this isn't included in the current interfaces. If a file cannot be opened with the access requested, `open-file' throws an exception. gc-stats - Scheme Procedure: gc-stats Return an association list of statistics about Guile's current use of storage. object-address - Scheme Procedure: object-address obj Return an integer that for the lifetime of OBJ is uniquely returned by this function for OBJ gc - Scheme Procedure: gc Scans all of SCM objects and reclaims for further use those that are no longer accessible. %compute-slots - Scheme Procedure: %compute-slots class Return a list consisting of the names of all slots belonging to class CLASS, i. e. the slots of CLASS and of all of its superclasses. get-keyword - Scheme Procedure: get-keyword key l default_value Determine an associated value for the keyword KEY from the list L. The list L has to consist of an even number of elements, where, starting with the first, every second element is a keyword, followed by its associated value. If L does not hold a value for KEY, the value DEFAULT_VALUE is returned. %initialize-object - Scheme Procedure: %initialize-object obj initargs Initialize the object OBJ with the given arguments INITARGS. %prep-layout! - Scheme Procedure: %prep-layout! class %inherit-magic! - Scheme Procedure: %inherit-magic! class dsupers instance? - Scheme Procedure: instance? obj Return `#t' if OBJ is an instance. class-name - Scheme Procedure: class-name obj Return the class name of OBJ. class-direct-supers - Scheme Procedure: class-direct-supers obj Return the direct superclasses of the class OBJ. class-direct-slots - Scheme Procedure: class-direct-slots obj Return the direct slots of the class OBJ. class-direct-subclasses - Scheme Procedure: class-direct-subclasses obj Return the direct subclasses of the class OBJ. class-direct-methods - Scheme Procedure: class-direct-methods obj Return the direct methods of the class OBJ class-precedence-list - Scheme Procedure: class-precedence-list obj Return the class precedence list of the class OBJ. class-slots - Scheme Procedure: class-slots obj Return the slot list of the class OBJ. class-environment - Scheme Procedure: class-environment obj Return the environment of the class OBJ. generic-function-name - Scheme Procedure: generic-function-name obj Return the name of the generic function OBJ. generic-function-methods - Scheme Procedure: generic-function-methods obj Return the methods of the generic function OBJ. method-generic-function - Scheme Procedure: method-generic-function obj Return the generic function for the method OBJ. method-specializers - Scheme Procedure: method-specializers obj Return specializers of the method OBJ. method-procedure - Scheme Procedure: method-procedure obj Return the procedure of the method OBJ.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -