(acons key value alist) Adds a new key-value pair to @var{alist}. A new pair is created whose car is @var{key} and whose cdr is @var{value}, and the pair is consed onto @var{alist}, and the new list is returned. This function is @emph{not} destructive; @var{alist} is not modified. [alist.c:59] (sloppy-assq key alist) Behaves like @code{assq} but does not do any error checking. Recommended only for use in Guile internals. [alist.c:82] (sloppy-assv key alist) Behaves like @code{assv} but does not do any error checking. Recommended only for use in Guile internals. [alist.c:100] (sloppy-assoc key alist) Behaves like @code{assoc} but does not do any error checking. Recommended only for use in Guile internals. [alist.c:118] (assq key alist) @deffnx primitive assv key alist @deffnx primitive assoc key alist Fetches the entry in @var{alist} that is associated with @var{key}. To decide whether the argument @var{key} matches a particular entry in @var{alist}, @code{assq} compares keys with @code{eq?}, @code{assv} uses @code{eqv?} and @code{assoc} uses @code{equal?}. If @var{key} cannot be found in @var{alist} (according to whichever equality predicate is in use), then @code{#f} is returned. These functions return the entire alist entry found (i.e. both the key and the value). [alist.c:145] (assv key alist) Behaves like @code{assq} but uses @code{eqv?} for key comparison. [alist.c:163] (assoc key alist) Behaves like @code{assq} but uses @code{equal?} for key comparison. [alist.c:181] (assq-ref alist key) @deffnx primitive assv-ref alist key @deffnx primitive assoc-ref alist key Like @code{assq}, @code{assv} and @code{assoc}, except that only the value associated with @var{key} in @var{alist} is returned. These functions are equivalent to @lisp (let ((ent (@var{associator} @var{key} @var{alist}))) (and ent (cdr ent))) @end lisp where @var{associator} is one of @code{assq}, @code{assv} or @code{assoc}. [alist.c:210] (assv-ref alist key) Behaves like @code{assq-ref} but uses @code{eqv?} for key comparison. [alist.c:227] (assoc-ref alist key) Behaves like @code{assq-ref} but uses @code{equal?} for key comparison. [alist.c:244] (assq-set! alist key val) @deffnx primitive assv-set! alist key value @deffnx primitive assoc-set! alist key value Reassociate @var{key} in @var{alist} with @var{value}: find any existing @var{alist} entry for @var{key} and associate it with the new @var{value}. If @var{alist} does not contain an entry for @var{key}, add a new one. Return the (possibly new) alist. These functions do not attempt to verify the structure of @var{alist}, and so may cause unusual results if passed an object that is not an association list. [alist.c:273] (assv-set! alist key val) Behaves like @code{assq-set!} but uses @code{eqv?} for key comparison. [alist.c:291] (assoc-set! alist key val) Behaves like @code{assq-set!} but uses @code{equal?} for key comparison. [alist.c:309] (assq-remove! alist key) @deffnx primitive assv-remove! alist key @deffnx primitive assoc-remove! alist key Delete any entry in @var{alist} associated with @var{key}, and return the resulting alist. [alist.c:333] (assv-remove! alist key) Behaves like @code{assq-remove!} but uses @code{eqv?} for key comparison. [alist.c:351] (assoc-remove! alist key) Behaves like @code{assq-remove!} but uses @code{equal?} for key comparison. [alist.c:369] (make-arbiter name) Returns an object of type arbiter and name name. Its state is initially unlocked. Arbiters are a way to achieve process synchronization. [arbiters.c:82] (try-arbiter arb) Returns #t and locks arbiter if arbiter was unlocked. Otherwise, returns #f. [arbiters.c:91] (release-arbiter arb) Returns #t and unlocks arbiter if arbiter was locked. Otherwise, returns #f. [arbiters.c:111] (async thunk) [async.c:303] (system-async thunk) [async.c:312] (async-mark a) [async.c:329] (system-async-mark a) [async.c:345] (run-asyncs list_of_a) [async.c:365] (noop args) [async.c:398] (unmask-signals) [async.c:478] (mask-signals) [async.c:489] (display-error stack port subr message args rest) [backtrace.c:224] (display-application frame port indent) [backtrace.c:365] (display-backtrace stack port first depth) [backtrace.c:579] (backtrace) [backtrace.c:601] (not x) Return #t iff X is #f, else return #f. [boolean.c:55] (boolean? obj) Return #t iff OBJ is either #t or #f. [boolean.c:65] (char? x) Return #t iff X is a character, else #f. [chars.c:55] (char=? x y) Return #t iff X is the same character as Y, else #f. [chars.c:64] (char? x y) Return #t iff X is greater than Y in the Ascii sequence, else #f. [chars.c:98] (char>=? x y) Return #t iff X is greater than or equal to Y in the Ascii sequence, else #f. [chars.c:109] (char-ci=? x y) Return #t iff X is the same character as Y ignoring case, else #f. [chars.c:120] (char-ci? x y) Return #t iff X is greater than Y in the Ascii sequence ignoring case, else #f. [chars.c:153] (char-ci>=? x y) Return #t iff X is greater than or equal to Y in the Ascii sequence ignoring case, else #f. [chars.c:164] (char-alphabetic? chr) Return #t iff CHR is alphabetic, else #f. Alphabetic means the same thing as the isalpha C library function. [chars.c:177] (char-numeric? chr) Return #t iff CHR is numeric, else #f. Numeric means the same thing as the isdigit C library function. [chars.c:188] (char-whitespace? chr) Return #t iff CHR is whitespace, else #f. Whitespace means the same thing as the isspace C library function. [chars.c:199] (char-upper-case? chr) Return #t iff CHR is uppercase, else #f. Uppercase means the same thing as the isupper C library function. [chars.c:212] (char-lower-case? chr) Return #t iff CHR is lowercase, else #f. Lowercase means the same thing as the islower C library function. [chars.c:224] (char-is-both? chr) Return #t iff CHR is either uppercase or lowercase, else #f. Uppercase and lowercase are as defined by the isupper and islower C library functions. [chars.c:238] (char->integer chr) Return the number corresponding to ordinal position of CHR in the Ascii sequence. [chars.c:251] (integer->char n) Return the character at position N in the Ascii sequence. [chars.c:263] (char-upcase chr) Return the uppercase character version of CHR. [chars.c:274] (char-downcase chr) Return the lowercase character version of CHR. [chars.c:285] (debug-options-interface setting) [debug.c:76] (with-traps thunk) [debug.c:124] (memoized? obj) [debug.c:165] (unmemoize m) [debug.c:367] (memoized-environment m) [debug.c:377] (procedure-name proc) [debug.c:387] (procedure-source proc) [debug.c:413] (procedure-environment proc) [debug.c:448] (local-eval exp env) Evaluate @var{exp} in its environment. If @var{env} is supplied, it is the environment in which to evaluate @var{exp}. Otherwise, @var{exp} must be a memoized code object (in which case, its environment is implicit). [debug.c:481] (debug-object? obj) [debug.c:568] (c-registered-modules) Return a list of the object code modules that have been imported into the current Guile process. Each element of the list is a pair whose car is the name of the module, and whose cdr is the function handle for that module's initializer function. The name is the string that has been passed to scm_register_module_xxx. [dynl.c:183] (c-clear-registered-modules) Destroy the list of modules registered with the current Guile process. The return value is unspecified. @strong{Warning:} this function does not actually unlink or deallocate these modules, but only destroys the records of which modules have been loaded. It should therefore be used only by module bookkeeping operations. [dynl.c:204] (dynamic-link fname) Open the dynamic library @var{library-file}. A library handle representing the opened library is returned; this handle should be used as the @var{lib} argument to the following functions. [dynl.c:350] (dynamic-object? obj) Return @code{#t} if @var{obj} is a dynamic library handle, or @code{#f} otherwise. [dynl.c:365] (dynamic-unlink dobj) Unlink the library represented by @var{library-handle}, and remove any imported symbols from the address space. GJB:FIXME:DOC: 2nd version below: Unlink the indicated object file from the application. The argument @var{dynobj} must have been obtained by a call to @code{dynamic-link}. After @code{dynamic-unlink} has been called on @var{dynobj}, its content is no longer accessible. [dynl.c:381] (dynamic-func symb dobj) Import the symbol @var{func} from @var{lib} (a dynamic library handle). A @dfn{function handle} representing the imported function is returned. GJB:FIXME:DOC: 2nd version below Search the C function indicated by @var{function} (a string or symbol) in @var{dynobj} and return some Scheme object that can later be used with @code{dynamic-call} to actually call this function. Right now, these Scheme objects are formed by casting the address of the function to @code{long} and converting this number to its Scheme representation. Regardless whether your C compiler prepends an underscore @samp{_} to the global names in a program, you should @strong{not} include this underscore in @var{function}. Guile knows whether the underscore is needed or not and will add it when necessary. [dynl.c:413] (dynamic-call func dobj) Call @var{lib-thunk}, a procedure of no arguments. If @var{lib-thunk} is a string, it is assumed to be a symbol found in the dynamic library @var{lib} and is fetched with @code{dynamic-func}. Otherwise, it should be a function handle returned by a previous call to @code{dynamic-func}. The return value is unspecified. GJB:FIXME:DOC 2nd version below Call the C function indicated by @var{function} and @var{dynobj}. The function is passed no arguments and its return value is ignored. When @var{function} is something returned by @code{dynamic-func}, call that function and ignore @var{dynobj}. When @var{function} is a string (or symbol, etc.), look it up in @var{dynobj}; this is equivalent to @smallexample (dynamic-call (dynamic-func @var{function} @var{dynobj} #f)) @end smallexample Interrupts are deferred while the C function is executing (with @code{SCM_DEFER_INTS}/@code{SCM_ALLOW_INTS}). [dynl.c:453] (dynamic-args-call func dobj args) Call @var{proc}, a dynamically loaded function, passing it the argument list @var{args} (a list of strings). As with @code{dynamic-call}, @var{proc} should be either a function handle or a string, in which case it is first fetched from @var{lib} with @code{dynamic-func}. @var{proc} is assumed to return an integer, which is used as the return value from @code{dynamic-args-call}. GJB:FIXME:DOC 2nd version below Call the C function indicated by @var{function} and @var{dynobj}, just like @code{dynamic-call}, but pass it some arguments and return its return value. The C function is expected to take two arguments and return an @code{int}, just like @code{main}: @smallexample int c_func (int argc, char **argv); @end smallexample The parameter @var{args} must be a list of strings and is converted into an array of @code{char *}. The array is passed in @var{argv} and its size in @var{argc}. The return value is converted to a Scheme number and returned from the call to @code{dynamic-args-call}. [dynl.c:488] (dynamic-wind thunk1 thunk2 thunk3) All three arguments must be 0-argument procedures. @var{in-guard} is called, then @var{thunk}, then @var{out-guard}. If, any time during the execution of @var{thunk}, the continuation of the @code{dynamic-wind} expression is escaped non-locally, @var{out-guard} is called. If the continuation of the dynamic-wind is re-entered, @var{in-guard} is called. Thus @var{in-guard} and @var{out-guard} may be called any number of times. @example (define x 'normal-binding) @result{} x (define a-cont (call-with-current-continuation (lambda (escape) (let ((old-x x)) (dynamic-wind ;; in-guard: ;; (lambda () (set! x 'special-binding)) ;; thunk ;; (lambda () (display x) (newline) (call-with-current-continuation escape) (display x) (newline) x) ;; out-guard: ;; (lambda () (set! x old-x))))))) ;; Prints: special-binding ;; Evaluates to: @result{} a-cont x @result{} normal-binding (a-cont #f) ;; Prints: special-binding ;; Evaluates to: @result{} a-cont ;; the value of the (define a-cont...) x @result{} normal-binding a-cont @result{} special-binding @end example [dynwind.c:115] (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?'. [eq.c:63] (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. [eq.c:77] (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. [eq.c:126] (scm-error key subr message args rest) Raise an error with key @var{key}. @var{subr} can be a string naming the procedure associated with the error, or @code{#f}. @var{message} is the error message string, possibly containing @code{~S} and @code{~A} escapes. When an error is reported, these are replaced by formating the corresponding members of @var{args}: @code{~A} (was @code{%s}) formats using @code{display} and @code(~S) (was @code{%S}) formats using @code{write}. @var{data} is a list or @code{#f} depending on @var{key}: if @var{key} is @code{system-error} then it should be a list containing the Unix @code{errno} value; If @var{key} is @code{signal} then it should be a list containing the Unix signal number; otherwise it will usually be @code{#f}. [error.c:112] (strerror err) Returns the Unix error message corresponding to @var{err}, an integer. [error.c:129] (apply:nconc2last lst) [eval.c:3220] (force x) If the promise X has not been computed yet, compute and return X, otherwise just return the previously computed value. [eval.c:3736] (promise? x) Return true if @var{obj} is a promise, i.e. a delayed computation (@pxref{Delayed evaluation,,,r4rs.info,The Revised^4 Report on Scheme}). [eval.c:3759] (cons-source xorig x y) [eval.c:3769] (copy-tree obj) Recursively copy the data tree that is bound to @var{obj}, and return a pointer to the new data structure. @code{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. [eval.c:3791] (eval2 obj env_thunk) Evaluate @var{exp}, a Scheme expression, in the environment designated by @var{lookup}, a symbol-lookup function. @code{(eval exp)} is equivalent to @code{(eval2 exp *top-level-lookup-closure*)}. [eval.c:3837] (eval obj) Evaluate @var{exp}, a list representing a Scheme expression, in the top-level environment. [eval.c:3847] (eval-options-interface setting) [eval.c:1712] (evaluator-traps-interface setting) [eval.c:1729] (defined? sym env) Return @code{#t} if @var{sym} is defined in the top-level environment. [evalext.c:71] (map-in-order) scm_map [evalext.c:150] (program-arguments) [feature.c:74] (chown object owner group) Change the ownership and group of the file referred to by @var{object} to the integer values @var{owner} and @var{group}. @var{object} can be a string containing a file name or, if the platform supports fchown, a port or integer file descriptor which is open on the file. The return value is unspecified. If @var{object} is a symbolic link, either the ownership of the link or the ownership of the referenced file will be changed depending on the operating system (lchown is unsupported at present). If @var{owner} or @var{group} is specified as @code{-1}, then that ID is not changed. [filesys.c:136] (chmod object mode) Changes the permissions of the file referred to by @var{obj}. @var{obj} can be a string containing a file name or a port or integer file descriptor which is open on a file (in which case @code{fchmod} is used as the underlying system call). @var{mode} specifies the new permissions as a decimal number, e.g., @code{(chmod \"foo\" #o755)}. The return value is unspecified. [filesys.c:176] (umask mode) If @var{mode} is omitted, retuns a decimal number representing the current file creation mask. Otherwise the file creation mask is set to @var{mode} and the previous value is returned. E.g., @code{(umask #o022)} sets the mask to octal 22, decimal 18. [filesys.c:210] (open-fdes path flags mode) Similar to @code{open} but returns a file descriptor instead of a port. [filesys.c:233] (open path flags mode) Open the file named by @var{path} for reading and/or writing. @var{flags} is an integer specifying how the file should be opened. @var{mode} is an integer specifying the permission bits of the file, if it needs to be created, before the umask is applied. The default is 666 (Unix itself has no default). @var{flags} can be constructed by combining variables using @code{logior}. Basic flags are: @defvar O_RDONLY Open the file read-only. @end defvar @defvar O_WRONLY Open the file write-only. @end defvar @defvar O_RDWR Open the file read/write. @end defvar @defvar O_APPEND Append to the file instead of truncating. @end defvar @defvar O_CREAT Create the file if it does not already exist. @end defvar See the Unix documentation of the @code{open} system call for additional flags. [filesys.c:276] (close fd_or_port) Similar to close-port (@pxref{Generic Port Operations, close-port}), but also works on file descriptors. A side effect of closing a file descriptor is that any ports using that file descriptor are moved to a different file descriptor and have their revealed counts set to zero. [filesys.c:314] (stat object) Returns an object containing various information about the file determined by @var{obj}. @var{obj} can be a string containing a file name or a port or integer file descriptor which is open on a file (in which case @code{fstat} is used as the underlying system call). The object returned by @code{stat} can be passed as a single parameter to the following procedures, all of which return integers: @table @code @item stat:dev The device containing the file. @item stat:ino The file serial number, which distinguishes this file from all other files on the same device. @item stat:mode The mode of the file. This includes file type information and the file permission bits. See @code{stat:type} and @code{stat:perms} below. @item stat:nlink The number of hard links to the file. @item stat:uid The user ID of the file's owner. @item stat:gid The group ID of the file. @item stat:rdev Device ID; this entry is defined only for character or block special files. @item stat:size The size of a regular file in bytes. @item stat:atime The last access time for the file. @item stat:mtime The last modification time for the file. @item stat:ctime The last modification time for the attributes of the file. @item stat:blksize The optimal block size for reading or writing the file, in bytes. @item stat:blocks The amount of disk space that the file occupies measured in units of 512 byte blocks. @end table In addition, the following procedures return the information from stat:mode in a more convenient form: @table @code @item stat:type A symbol representing the type of file. Possible values are regular, directory, symlink, block-special, char-special, fifo, socket and unknown @item stat:perms An integer representing the access permission bits. @end table [filesys.c:492] (link oldpath newpath) Creates a new name @var{path-to} in the file system for the file named by @var{path-from}. If @var{path-from} is a symbolic link, the link may or may not be followed depending on the system. [filesys.c:538] (rename-file oldname newname) Renames the file specified by @var{path-from} to @var{path-to}. The return value is unspecified. [filesys.c:563] (delete-file str) Deletes (or \"unlinks\") the file specified by @var{path}. [filesys.c:592] (mkdir path mode) Create a new directory named by @var{path}. If @var{mode} is omitted then the permissions of the directory file are set using the current umask. Otherwise they are set to the decimal value specified with @var{mode}. The return value is unspecified. [filesys.c:611] (rmdir path) Remove the existing directory named by @var{path}. The directory must be empty for this to succeed. The return value is unspecified. [filesys.c:640] (directory-stream? obj) Returns a boolean indicating whether @var{object} is a directory stream as returned by @code{opendir}. [filesys.c:664] (opendir dirname) Open the directory specified by @var{path} and return a directory stream. [filesys.c:674] (readdir port) Return (as a string) the next directory entry from the directory stream @var{stream}. If there is no remaining entry to be read then the end of file object is returned. [filesys.c:692] (rewinddir port) Reset the directory port @var{stream} so that the next call to @code{readdir} will return the first directory entry. [filesys.c:711] (closedir port) Close the directory stream @var{stream}. The return value is unspecified. [filesys.c:725] (chdir str) Change the current working directory to @var{path}. The return value is unspecified. [filesys.c:775] (getcwd) Returns the name of the current working directory. [filesys.c:792] (select reads writes excepts secs usecs) This procedure has a variety of uses: waiting for the ability to provide input, accept output, or the existance of exceptional conditions on a collection of ports or file descriptors, or waiting for a timeout to occur. It also returns if interrupted by a signal. @var{reads}, @var{writes} and @var{excepts} can be lists or vectors, with each member a port or a file descriptor. The value returned is a list of three corresponding lists or vectors containing only the members which meet the specified requirement. The ability of port buffers to provide input or accept output is taken into account. Ordering of the input lists or vectors is not preserved. The optional arguments @var{secs} and @var{usecs} specify the timeout. Either @var{secs} can be specified alone, as either an integer or a real number, or both @var{secs} and @var{usecs} can be specified as integers, in which case @var{usecs} is an additional timeout expressed in microseconds. If @var{secs} is omitted or is @code{#f} then select will wait for as long as it takes for one of the other conditions to be satisfied. The scsh version of @code{select} differs as follows: Only vectors are accepted for the first three arguments. The @var{usecs} argument is not supported. Multiple values are returned instead of a list. Duplicates in the input vectors appear only once in output. An additional @code{select!} interface is provided. [filesys.c:989] (fcntl object cmd value) Apply @var{command} to the specified file descriptor or the underlying file descriptor of the specified port. @var{value} is an optional integer argument. Values for @var{command} are: @table @code @item F_DUPFD Duplicate a file descriptor @item F_GETFD Get flags associated with the file descriptor. @item F_SETFD Set flags associated with the file descriptor to @var{value}. @item F_GETFL Get flags associated with the open file. @item F_SETFL Set flags associated with the open file to @var{value} @item F_GETOWN Get the process ID of a socket's owner, for @code{SIGIO} signals. @item F_SETOWN Set the process that owns a socket to @var{value}, for @code{SIGIO} signals. @item FD_CLOEXEC The value used to indicate the \"close on exec\" flag with @code{F_GETFL} or" @code{F_SETFL}." @end table [filesys.c:1137] (fsync object) Copies any unwritten data for the specified output file descriptor to disk. If @var{port/fd} is a port, its buffer is flushed before the underlying file descriptor is fsync'd. The return value is unspecified. [filesys.c:1173] (symlink oldpath newpath) Create a symbolic link named @var{path-to} with the value (i.e., pointing to) @var{path-from}. The return value is unspecified. [filesys.c:1200] (readlink path) Returns the value of the symbolic link named by @var{path} (a string), i.e., the file that the link points to. [filesys.c:1222] (lstat str) Similar to @code{stat}, but does not follow symbolic links, i.e., it will return information about a symbolic link itself, not the file it points to. @var{path} must be a string. [filesys.c:1252] (copy-file oldfile newfile) Copy the file specified by @var{path-from} to @var{path-to}. The return value is unspecified. [filesys.c:1278] (dirname filename) [filesys.c:1325] (basename filename suffix) [filesys.c:1351] (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. [fluids.c:127] (fluid? obj) Return #t iff @var{obj} is a fluid; otherwise, return #f. [fluids.c:140] (fluid-ref fluid) Return the value associated with @var{fluid} in the current dynamic root. If @var{fluid} has not been set, then this returns #f. [fluids.c:150] (fluid-set! fluid value) Set the value associated with @var{fluid} in the current dynamic root. [fluids.c:167] (with-fluids* fluids values thunk) Set @var{fluids} to @var{values} temporary, and call @var{thunk}. @var{fluids} must be a list of fluids and @var{values} must be the same number of their values to be applied. Each substitution is done one after another. @var{thunk} must be a procedure with no argument. [fluids.c:226] (setvbuf port mode size) Set the buffering mode for @var{port}. @var{mode} can be: @table @code @item _IONBF non-buffered @item _IOLBF line buffered @item _IOFBF block buffered, using a newly allocated buffer of @var{size} bytes. If @var{size} is omitted, a default size will be used. @end table [fports.c:144] (open-file filename modes) Open the file whose name is @var{string}, and return a port representing that file. The attributes of the port are determined by the @var{mode} string. The way in which this is interpreted is similar to C stdio: The first character must be one of the following: @table @samp @item r Open an existing file for input. @item w Open a file for output, creating it if it doesn't already exist or removing its contents if it does. @item 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 @pxref{Ports and File Descriptors, fcntl} @end table The following additional characters can be appended: @table @samp @item + Open the port for both input and output. E.g., @code{r+}: open an existing file for both input and output. @item 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 @pxref{Ports and File Descriptors, setvbuf} @item l Add line-buffering to the port. The port output buffer will be automatically flushed whenever a newline character is written. @end table 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, @code{open-file} throws an exception. [fports.c:267] (gc-stats) Returns an association list of statistics about Guile's current use of storage. [gc.c:559] (object-address obj) Return an integer that for the lifetime of @var{obj} is uniquely returned by this function for @var{obj} [gc.c:632] (gc) Scans all of SCM objects and reclaims for further use those that are no longer accessible. [gc.c:643] (unhash-name name) [gc.c:2047] (make-guardian) Create a new guardian. A guardian protects a set of objects from garbage collection, allowing a program to apply cleanup or other actions. make-guardian returns a procedure representing the guardian. Calling the guardian procedure with an argument adds the argument to the guardian's set of protected objects. Calling the guardian procedure without an argument returns one of the protected objects which are ready for garbage collection or @code{#f} if no such object is available. Objects which are returned in this way are removed from the guardian. . See R. Kent Dybvig, Carl Bruggeman, and David Eby (1993) \"Guardians in a Generation-Based Garbage Collector\". ACM SIGPLAN Conference on Programming Language Design and Implementation, June 1993. [guardians.c:179] (hashq key size) Determine a hash value for KEY that is suitable for lookups in a hashtable of size SIZE, where eq? is used as the equality predicate. The function returns an integer in the range 0 to SIZE - 1. NOTE that `hashq' may use internal addresses. Thus two calls to hashq where the keys are eq? are not guaranteed to deliver the same value if the key object gets garbage collected in between. This can happen, for example with symbols: (hashq 'foo n) (gc) (hashq 'foo n) may produce two different values, since 'foo will be garbage collected. [hash.c:176] (hashv key size) Determine a hash value for KEY that is suitable for lookups in a hashtable of size SIZE, where eqv? is used as the equality predicate. The function returns an integer in the range 0 to SIZE - 1. NOTE that (hashv key) may use internal addresses. Thus two calls to hashv where the keys are eqv? are not guaranteed to deliver the same value if the key object gets garbage collected in between. This can happen, for example with symbols: (hashv 'foo n) (gc) (hashv 'foo n) may produce two different values, since 'foo will be garbage collected. [hash.c:211] (hash key size) Determine a hash value for KEY that is suitable for lookups in a hashtable of size SIZE, where equal? is used as the equality predicate. The function returns an integer in the range 0 to SIZE - 1. [hash.c:234] (hashq-get-handle table obj) This procedure is similar to its @code{-ref} cousin, but returns a @dfn{handle} from the hash table rather than the value associated with @var{key}. By convention, a handle in a hash table is the pair which associates a key with a value. Where @code{hashq-ref table key} returns only a @code{value}, @code{hashq-get-handle table key} returns the pair @code{(key . value)}. [hashtab.c:174] (hashq-create-handle! table key init) This function looks up @var{key} in @var{table} and returns its handle. If @var{key} is not already present, a new handle is created which associates @var{key} with @var{init}. [hashtab.c:186] (hashq-ref table obj dflt) Look up @var{key} in the hash table @var{table}, and return the value (if any) associated with it. If @var{key} is not found, return @var{default} (or @code{#f} if no @var{default} argument is supplied). Uses `eq?' for equality testing. [hashtab.c:199] (hashq-set! table obj val) Find the entry in @var{table} associated with @var{key}, and store @var{value} there. Uses `eq?' for equality testing. [hashtab.c:213] (hashq-remove! table obj) Remove @var{key} (and any value associated with it) from @var{table}. Uses `eq?' for equality tests. [hashtab.c:225] (hashv-get-handle table obj) This procedure is similar to its @code{-ref} cousin, but returns a @dfn{handle} from the hash table rather than the value associated with @var{key}. By convention, a handle in a hash table is the pair which associates a key with a value. Where @code{hashv-ref table key} returns only a @code{value}, @code{hashv-get-handle table key} returns the pair @code{(key . value)}. [hashtab.c:242] (hashv-create-handle! table key init) This function looks up @var{key} in @var{table} and returns its handle. If @var{key} is not already present, a new handle is created which associates @var{key} with @var{init}. [hashtab.c:254] (hashv-ref table obj dflt) Look up @var{key} in the hash table @var{table}, and return the value (if any) associated with it. If @var{key} is not found, return @var{default} (or @code{#f} if no @var{default} argument is supplied). Uses `eqv?' for equality testing. [hashtab.c:267] (hashv-set! table obj val) Find the entry in @var{table} associated with @var{key}, and store @var{value} there. Uses `eqv?' for equality testing. [hashtab.c:281] (hashv-remove! table obj) Remove @var{key} (and any value associated with it) from @var{table}. Uses `eqv?' for equality tests. [hashtab.c:292] (hash-get-handle table obj) This procedure is similar to its @code{-ref} cousin, but returns a @dfn{handle} from the hash table rather than the value associated with @var{key}. By convention, a handle in a hash table is the pair which associates a key with a value. Where @code{hash-ref table key} returns only a @code{value}, @code{hash-get-handle table key} returns the pair @code{(key . value)}. [hashtab.c:308] (hash-create-handle! table key init) This function looks up @var{key} in @var{table} and returns its handle. If @var{key} is not already present, a new handle is created which associates @var{key} with @var{init}. [hashtab.c:320] (hash-ref table obj dflt) Look up @var{key} in the hash table @var{table}, and return the value (if any) associated with it. If @var{key} is not found, return @var{default} (or @code{#f} if no @var{default} argument is supplied). Uses `equal?' for equality testing. [hashtab.c:333] (hash-set! table obj val) Find the entry in @var{table} associated with @var{key}, and store @var{value} there. Uses `equal?' for equality testing. [hashtab.c:347] (hash-remove! table obj) Remove @var{key} (and any value associated with it) from @var{table}. Uses `equal?' for equality tests. [hashtab.c:359] (hashx-get-handle hash assoc table obj) This behaves the same way as the corresponding @code{-get-handle} function, but uses @var{hasher} as a hash function and @var{assoc} to compare keys. @code{hasher} must be a function that takes two arguments, a key to be hashed and a table size. @code{assoc} must be an associator function, like @code{assoc}, @code{assq} or @code{assv}. [hashtab.c:428] (hashx-create-handle! hashassoctableobjinit) This behaves the same way as the corresponding @code{-create-handle} function, but uses @var{hasher} as a hash function and @var{assoc} to compare keys. @code{hasher} must be a function that takes two arguments, a key to be hashed and a table size. @code{assoc} must be an associator function, like @code{assoc}, @code{assq} or @code{assv}. [hashtab.c:446] (hashx-ref hashassoctableobjdflt) This behaves the same way as the corresponding @code{ref} function, but uses @var{hasher} as a hash function and @var{assoc} to compare keys. @code{hasher} must be a function that takes two arguments, a key to be hashed and a table size. @code{assoc} must be an associator function, like @code{assoc}, @code{assq} or @code{assv}. By way of illustration, @code{hashq-ref table key} is equivalent to @code{hashx-ref hashq assq table key}. [hashtab.c:467] (hashx-set! hash assoc table obj val) This behaves the same way as the corresponding @code{set!} function, but uses @var{hasher} as a hash function and @var{assoc} to compare keys. @code{hasher} must be a function that takes two arguments, a key to be hashed and a table size. @code{assoc} must be an associator function, like @code{assoc}, @code{assq} or @code{assv}. By way of illustration, @code{hashq-set! table key} is equivalent to @code{hashx-set! hashq assq table key}. [hashtab.c:491] (hash-fold proc init table) An iterator over hash-table elements. Accumulates and returns a result by applying PROC successively. The arguments to PROC are \"(key value prior-result)\" where key and value are successive pairs from the hash table TABLE, and prior-result is either INIT (for the first application of PROC) or the return value of the previous application of PROC. For example, @code{(hash-fold acons () tab)} will convert a hash table into an a-list of key-value pairs. [hashtab.c:528] (make-hook-with-name name n_args) [hooks.c:213] (make-hook n_args) [hooks.c:227] (hook? x) [hooks.c:237] (hook-empty? hook) [hooks.c:247] (add-hook! hook proc append_p) [hooks.c:258] (remove-hook! hook proc) [hooks.c:284] (reset-hook! hook) [hooks.c:297] (run-hook hook args) [hooks.c:309] (hook->list hook) [hooks.c:336] (%read-delimited! delims buf gobble port start end) Read characters from @var{port} into @var{buf} until one of the characters in the @var{delims} string is encountered. If @var{gobble?} is true, store the delimiter character in @var{buf} as well; otherwise, discard it. If @var{port} is not specified, use the value of @code{(current-input-port)}. If @var{start} or @var{end} are specified, store data only into the substring of @var{buf} bounded by @var{start} and @var{end} (which default to the beginning and end of the buffer, respectively). Return a pair consisting of the delimiter that terminated the string and the number of characters read. If reading stopped at the end of file, the delimiter returned is the @var{eof-object}; if the buffer was filled without encountering a delimiter, this value is @var{#f}. [ioext.c:83] (%read-line port) Read a newline-terminated line from @var{port}, allocating storage as necessary. The newline terminator (if any) is removed from the string, and a pair consisting of the line and its delimiter is returned. The delimiter may be either a newline or the @var{eof-object}; if @code{%read-line} is called at the end of file, it returns the pair @code{(# . #)}. [ioext.c:236] (write-line obj port) Display @var{obj} and a newline character to @var{port}. If @var{port} is not specified, @code{(current-output-port)} is used. This function is equivalent to: @smalllisp (display obj [port]) (newline [port]) @end smalllisp [ioext.c:290] (ftell object) Returns an integer representing the current position of @var{fd/port}, measured from the beginning. Equivalent to: @smalllisp (seek port 0 SEEK_CUR) @end smalllisp [ioext.c:304] (fseek object offset whence) Obsolete. Almost the same as seek, above, but the return value is unspecified. [ioext.c:317] (redirect-port old new) This procedure takes two ports and duplicates the underlying file descriptor from @var{old-port} into @var{new-port}. The current file descriptor in @var{new-port} will be closed. After the redirection the two ports will share a file position and file status flags. The return value is unspecified. Unexpected behaviour can result if both ports are subsequently used and the original and/or duplicate ports are buffered. This procedure does not have any side effects on other ports or revealed counts. [ioext.c:339] (dup->fdes fd_or_port fd) Returns an integer file descriptor. [ioext.c:376] (fileno port) Returns the integer file descriptor underlying @var{port}. Does not change its revealed count. [ioext.c:416] (isatty? port) Returns @code{#t} if @var{port} is using a serial non-file device, otherwise @code{#f}. [ioext.c:432] (fdopen fdes modes) Returns a new port based on the file descriptor @var{fdes}. Modes are given by the string @var{modes}. The revealed count of the port is initialized to zero. The modes string is the same as that accepted by @ref{File Ports, open-file}. [ioext.c:454] (primitive-move->fdes port fd) Moves the underlying file descriptor for @var{port} to the integer value @var{fdes} without changing the revealed count of @var{port}. Any other ports already using this descriptor will be automatically shifted to new descriptors and their revealed counts reset to zero. The return value is @code{#f} if the file descriptor already had the required value or @code{#t} if it was moved. [ioext.c:479] (fdes->ports fd) Returns a list of existing ports which have @var{fdes} as an underlying file descriptor, without changing their revealed counts. [ioext.c:512] (make-keyword-from-dash-symbol symbol) Return a keyword object from SYMBOL that starts with `-' (a dash). [keywords.c:69] (keyword? obj) Returns #t if the argument OBJ is a keyword, else #f. [keywords.c:107] (keyword-dash-symbol keyword) Return KEYWORD as a dash symbol. This is the inverse of `make-keyword-from-dash-symbol'. [keywords.c:118] (nil-cons x y) [lang.c:67] (nil-car x) [lang.c:81] (nil-cdr x) [lang.c:93] (null x) [lang.c:107] (nil-eq x y) [lang.c:135] (list objs) Return a list containing OBJS, the arguments to `list'. [list.c:82] (list*) scm_cons_star [list.c:92] (cons* arg rest) Like `list', but the last arg provides the tail of the constructed list, returning (cons ARG1 (cons ARG2 (cons ... ARGn))). Requires at least one argument. If given one argument, that argument is returned as result. This function is called `list*' in some other Schemes and in Common LISP. [list.c:102] (null? x) Return #t iff X is the empty list, else #f. [list.c:126] (list? x) Return #t iff X is a proper list, else #f. [list.c:136] (length lst) Return the number of elements in list LST. [list.c:177] (append args) Returns a list consisting of the elements of the first LIST followed by the elements of the other LISTs. (append '(x) '(y)) => (x y) (append '(a) '(b c d)) => (a b c d) (append '(a (b)) '((c))) => (a (b) (c)) The resulting list is always newly allocated, except that it shares structure with the last LIST argument. The last argument may actually be any object; an improper list results if the last argument is not a proper list. (append '(a b) '(c . d)) => (a b c . d) (append '() 'a) => a [list.c:205] (append! args) A destructive version of @code{append} (@pxref{Pairs and Lists,,,r4rs, The Revised^4 Report on Scheme}). The cdr field of each list's final pair is changed to point to the head of the next list, so no consing is performed. Return a pointer to the mutated list. [list.c:238] (last-pair lst) Return a pointer to the last pair in @var{lst}, signalling an error if @var{lst} is circular. [list.c:264] (reverse lst) Return a new list that contains the elements of LST but in reverse order. [list.c:293] (reverse! lst new_tail) A destructive version of @code{reverse} (@pxref{Pairs and Lists,,,r4rs, The Revised^4 Report on Scheme}). The cdr of each cell in @var{lst} is modified to point to the previous list element. Return a pointer to the head of the reversed list. Caveat: because the list is modified in place, the tail of the original list now becomes its head, and the head of the original list now becomes the tail. Therefore, the @var{lst} symbol to which the head of the original list was bound now points to the tail. To ensure that the head of the modified list is not lost, it is wise to save the return value of @code{reverse!} [list.c:327] (list-ref lst k) Return the Kth element from list LST. [list.c:353] (list-set! lst k val) Set the @var{k}th element of @var{lst} to @var{val}. [list.c:371] (list-cdr-ref) scm_list_tail [list.c:389] (list-tail lst k) Return the \"tail\" of @var{lst} beginning with its @var{k}th element. The first element of the list is considered to be element 0. @code{list-cdr-ref} and @code{list-tail} are identical. It may help to think of @code{list-cdr-ref} as accessing the @var{k}th cdr of the list, or returning the results of cdring @var{k} times down @var{lst}. [list.c:397] (list-cdr-set! lst k val) Set the @var{k}th cdr of @var{lst} to @var{val}. [list.c:413] (list-head lst k) Copy the first @var{k} elements from @var{lst} into a new list, and return it. [list.c:437] (list-copy lst) Return a (newly-created) copy of @var{lst}. [list.c:461] (sloppy-memq x lst) This procedure behaves like @code{memq}, but does no type or error checking. Its use is recommended only in writing Guile internals, not for high-level Scheme programs. [list.c:491] (sloppy-memv x lst) This procedure behaves like @code{memv}, but does no type or error checking. Its use is recommended only in writing Guile internals, not for high-level Scheme programs. [list.c:508] (sloppy-member x lst) This procedure behaves like @code{member}, but does no type or error checking. Its use is recommended only in writing Guile internals, not for high-level Scheme programs. [list.c:525] (memq x lst) Return the first sublist of LST whose car is `eq?' to X where the sublists of LST are the non-empty lists returned by `(list-tail LST K)' for K less than the length of LST. If X does not occur in LST, then `#f' (not the empty list) is returned. [list.c:545] (memv x lst) Return the first sublist of LST whose car is `eqv?' to X where the sublists of LST are the non-empty lists returned by `(list-tail LST K)' for K less than the length of LST. If X does not occur in LST, then `#f' (not the empty list) is returned. [list.c:563] (member x lst) Return the first sublist of LST whose car is `equal?' to X where the sublists of LST are the non-empty lists returned by `(list-tail LST K)' for K less than the length of LST. If X does not occur in LST, then `#f' (not the empty list) is returned. [list.c:580] (delq! item lst) @deffnx primitive delv! item lst @deffnx primitive delete! item lst These procedures are destructive versions of @code{delq}, @code{delv} and @code{delete}: they modify the pointers in the existing @var{lst} rather than creating a new list. Caveat evaluator: Like other destructive list functions, these functions cannot modify the binding of @var{lst}, and so cannot be used to delete the first element of @var{lst} destructively. [list.c:603] (delv! item lst) Destructively remove all elements from LST that are `eqv?' to ITEM. [list.c:626] (delete! item lst) Destructively remove all elements from LST that are `equal?' to ITEM. [list.c:650] (delq item lst) Return a newly-created copy of @var{lst} with elements `eq?' to @var{item} removed. This procedure mirrors @code{memq}: @code{delq} compares elements of @var{lst} against @var{item} with @code{eq?}. [list.c:679] (delv item lst) Return a newly-created copy of @var{lst} with elements `eqv?' to @var{item} removed. This procedure mirrors @code{memv}: @code{delv} compares elements of @var{lst} against @var{item} with @code{eqv?}. [list.c:692] (delete item lst) Return a newly-created copy of @var{lst} with elements `equal?' to @var{item} removed. This procedure mirrors @code{member}: @code{delete} compares elements of @var{lst} against @var{item} with @code{equal?}. [list.c:705] (delq1! item lst) Like `delq!', but only deletes the first occurrence of ITEM from LST. Tests for equality using `eq?'. See also `delv1!' and `delete1!'. [list.c:717] (delv1! item lst) Like `delv!', but only deletes the first occurrence of ITEM from LST. Tests for equality using `eqv?'. See also `delq1!' and `delete1!'. [list.c:744] (delete1! item lst) Like `delete!', but only deletes the first occurrence of ITEM from LST. Tests for equality using `equal?'. See also `delq1!' and `delv1!'. [list.c:771] (primitive-load filename) Load @var{file} and evaluate its contents in the top-level environment. The load paths are not searched; @var{file} must either be a full pathname or be a pathname relative to the current directory. If the variable @code{%load-hook} is defined, it should be bound to a procedure that will be called before any code is loaded. See documentation for @code{%load-hook} later in this section. [load.c:107] (%package-data-dir) Return the name of the directory where Scheme packages, modules and libraries are kept. On most Unix systems, this will be @samp{/usr/local/share/guile}. [load.c:142] (%library-dir) Return the directory where the Guile Scheme library files are installed. E.g., may return \"/usr/share/guile/1.3.5\". [load.c:154] (%site-dir) Return the directory where the Guile site files are installed. E.g., may return \"/usr/share/guile/site\". [load.c:166] (parse-path path tail) [load.c:215] (search-path path filename extensions) [load.c:260] (%search-load-path filename) Search @var{%load-path} for @var{file}, which must be readable by the current user. If @var{file} is found in the list of paths to search or is an absolute pathname, return its full pathname. Otherwise, return @code{#f}. Filenames may have any of the optional extensions in the @code{%load-extensions} list; @code{%search-load-path} will try each extension automatically. [load.c:408] (primitive-load-path filename) Search @var{%load-path} for @var{file} and load it into the top-level environment. If @var{file} is a relative pathname and is not found in the list of search paths, an error is signalled. [load.c:429] (read-and-eval! port) Read a form from @var{port} (standard input by default), and evaluate it (memoizing it in the process) in the top-level environment. If no data is left to be read from @var{port}, an @code{end-of-file} error is signalled. [load.c:464] (procedure->syntax code) Returns a @dfn{macro} which, when a symbol defined to this value appears as the first symbol in an expression, returns the result of applying @var{code} to the expression and the environment. [macros.c:58] (procedure->macro code) Returns a @dfn{macro} which, when a symbol defined to this value appears as the first symbol in an expression, evaluates the result of applying @var{code} to the expression and the environment. The value returned from @var{code} which has been passed to @code{procedure->memoizing-macro} replaces the form passed to @var{code}. For example: @example (define trace (procedure->macro (lambda (x env) `(set! ,(cadr x) (tracef ,(cadr x) ',(cadr x)))))) (trace @i{foo}) @equiv{} (set! @i{foo} (tracef @i{foo} '@i{foo})). @end example [macros.c:80] (procedure->memoizing-macro code) Returns a @dfn{macro} which, when a symbol defined to this value appears as the first symbol in an expression, evaluates the result of applying @var{proc} to the expression and the environment. The value returned from @var{proc} which has been passed to @code{procedure->memoizing-macro} replaces the form passed to @var{proc}. For example: @example (define trace (procedure->macro (lambda (x env) `(set! ,(cadr x) (tracef ,(cadr x) ',(cadr x)))))) (trace @i{foo}) @equiv{} (set! @i{foo} (tracef @i{foo} '@i{foo})). @end example [macros.c:102] (macro? obj) Return @code{#t} if @var{obj} is a regular macro, a memoizing macro or a syntax transformer. [macros.c:114] (macro-type m) Return one of the symbols @code{syntax}, @code{macro} or @code{macro!}, depending on whether @var{obj} is a syntax tranformer, a regular macro, or a memoizing macro, respectively. If @var{obj} is not a macro, @code{#f} is returned. [macros.c:131] (macro-name m) [macros.c:149] (macro-transformer m) [macros.c:160] (standard-eval-closure module) [modules.c:243] (inet-aton address) Converts a string containing an Internet host address in the traditional dotted decimal notation into an integer. @smalllisp (inet-aton \"127.0.0.1\") @result{} 2130706433 @end smalllisp [net_db.c:94] (inet-ntoa inetid) Converts an integer Internet host address into a string with the traditional dotted decimal representation. @smalllisp (inet-ntoa 2130706433) @result{} \"127.0.0.1\"" @end smalllisp [net_db.c:115] (inet-netof address) Returns the network number part of the given integer Internet address. @smalllisp (inet-netof 2130706433) @result{} 127 @end smalllisp [net_db.c:134] (inet-lnaof address) Returns the local-address-with-network part of the given Internet address. @smalllisp (inet-lnaof 2130706433) @result{} 1 @end smalllisp [net_db.c:151] (inet-makeaddr net lna) Makes an Internet host address by combining the network number @var{net} with the local-address-within-network number @var{lna}. @smalllisp (inet-makeaddr 127 1) @result{} 2130706433 @end smalllisp [net_db.c:168] (gethost name) @deffnx procedure gethostbyname hostname @deffnx procedure gethostbyaddr address Look up a host by name or address, returning a host object. The @code{gethost} procedure will accept either a string name or an integer address; if given no arguments, it behaves like @code{gethostent} (see below). If a name or address is supplied but the address can not be found, an error will be thrown to one of the keys: @code{host-not-found}, @code{try-again}, @code{no-recovery} or @code{no-data}, corresponding to the equivalent @code{h_error} values. Unusual conditions may result in errors thrown to the @code{system-error} or @code{misc_error} keys. [net_db.c:253] (getnet name) @deffnx procedure getnetbyname net-name @deffnx procedure getnetbyaddr net-number Look up a network by name or net number in the network database. The @var{net-name} argument must be a string, and the @var{net-number} argument must be an integer. @code{getnet} will accept either type of argument, behaving like @code{getnetent} (see below) if no arguments are given. [net_db.c:334] (getproto name) @deffnx procedure getprotobyname name @deffnx procedure getprotobynumber number Look up a network protocol by name or by number. @code{getprotobyname} takes a string argument, and @code{getprotobynumber} takes an integer argument. @code{getproto} will accept either type, behaving like @code{getprotoent} (see below) if no arguments are supplied. [net_db.c:386] (getserv name proto) @deffnx procedure getservbyname name protocol @deffnx procedure getservbyport port protocol Look up a network service by name or by service number, and return a network service object. The @var{protocol} argument specifies the name of the desired protocol; if the protocol found in the network service database does not match this name, a system error is signalled. The @code{getserv} procedure will take either a service name or number as its first argument; if given no arguments, it behaves like @code{getservent} (see below). [net_db.c:455] (sethost arg) If @var{stayopen} is omitted, this is equivalent to @code{endhostent}. Otherwise it is equivalent to @code{sethostent stayopen}. [net_db.c:496] (setnet arg) If @var{stayopen} is omitted, this is equivalent to @code{endnetent}. Otherwise it is equivalent to @code{setnetent stayopen}. [net_db.c:512] (setproto arg) If @var{stayopen} is omitted, this is equivalent to @code{endprotoent}. Otherwise it is equivalent to @code{setprotoent stayopen}. [net_db.c:528] (setserv arg) If @var{stayopen} is omitted, this is equivalent to @code{endservent}. Otherwise it is equivalent to @code{setservent stayopen}. [net_db.c:544] (exact? x) Return #t if X is an exact number, #f otherwise. [numbers.c:101] (odd? n) Return #t if N is an odd number, #f otherwise. [numbers.c:117] (even? n) Return #t if N is an even number, #f otherwise. [numbers.c:133] (logand n1 n2) Returns the integer which is the bit-wise AND of the two integer arguments. Example: @lisp (number->string (logand #b1100 #b1010) 2) @result{} \"1000" [numbers.c:715] (logior n1 n2) Returns the integer which is the bit-wise OR of the two integer arguments. Example: @lisp (number->string (logior #b1100 #b1010) 2) @result{} \"1110" @end lisp [numbers.c:802] (logxor n1 n2) Returns the integer which is the bit-wise XOR of the two integer arguments. Example: @lisp (number->string (logxor #b1100 #b1010) 2) @result{} \"110" @end lisp [numbers.c:888] (logtest n1 n2) @example (logtest j k) @equiv{} (not (zero? (logand j k))) (logtest #b0100 #b1011) @result{} #f (logtest #b0100 #b0111) @result{} #t @end example [numbers.c:957] (logbit? index j) @example (logbit? index j) @equiv{} (logtest (integer-expt 2 index) j) (logbit? 0 #b1101) @result{} #t (logbit? 1 #b1101) @result{} #f (logbit? 2 #b1101) @result{} #t (logbit? 3 #b1101) @result{} #t (logbit? 4 #b1101) @result{} #f @end example [numbers.c:1014] (lognot n) Returns the integer which is the 2s-complement of the integer argument. Example: @lisp (number->string (lognot #b10000000) 2) @result{} \"-10000001" (number->string (lognot #b0) 2) @result{} \"-1" @end lisp [numbers.c:1063] (integer-expt n k) Returns @var{n} raised to the non-negative integer exponent @var{k}. Example: @lisp (integer-expt 2 5) @result{} 32 (integer-expt -3 3) @result{} -27 @end lisp [numbers.c:1079] (ash n cnt) The function ash performs an arithmetic shift left by CNT bits (or shift right, if CNT is negative). 'Arithmetic' means, that the function does not guarantee to keep the bit structure of N, but rather guarantees that the result will always be rounded towards minus infinity. Therefore, the results of ash and a corresponding bitwise shift will differ if N is negative. Formally, the function returns an integer equivalent to @code{(inexact->exact (floor (* N (expt 2 CNT))))}.@refill Example: @lisp (number->string (ash #b1 3) 2) @result{} \"1000\"" (number->string (ash #b1010 -1) 2)" @result{} \"101\"" @end lisp [numbers.c:1126] (bit-extract n start end) Returns the integer composed of the @var{start} (inclusive) through @var{end} (exclusive) bits of @var{n}. The @var{start}th bit becomes the 0-th bit in the result.@refill Example: @lisp (number->string (bit-extract #b1101101010 0 4) 2) @result{} \"1010" (number->string (bit-extract #b1101101010 4 9) 2) @result{} \"10110" @end lisp [numbers.c:1179] (logcount n) Returns the number of bits in integer @var{n}. If integer is positive, the 1-bits in its binary representation are counted. If negative, the 0-bits in its two's-complement binary representation are counted. If 0, 0 is returned. Example: @lisp (logcount #b10101010) @result{} 4 (logcount 0) @result{} 0 (logcount -2) @result{} 1 @end lisp [numbers.c:1220] (integer-length n) Returns the number of bits neccessary to represent @var{n}. Example: @lisp (integer-length #b10101010) @result{} 8 (integer-length 0) @result{} 0 (integer-length #b1111) @result{} 4 @end lisp [numbers.c:1271] (number->string n radix) Return a string holding the external representation of the number N in the given RADIX. If N is inexact, a radix of 10 will be used. [numbers.c:2218] (string->number string radix) Returns a number of the maximally precise representation expressed by the given STRING. RADIX must be an exact integer, either 2, 8, 10, or 16. If supplied, RADIX is a default radix that may be overridden by an explicit radix prefix in STRING (e.g. \"#o177\"). If RADIX is not supplied, then the default radix is 10. If string is not a syntactically valid notation for a number, then `string->number' returns #f. (r5rs) [numbers.c:2802] (number?) scm_number_p [numbers.c:2869] (complex? x) Return #t if X is a complex number, #f else. Note that the sets of real, rational and integer values form subsets of the set of complex numbers, i. e. the predicate will also be fulfilled if X is a real, rational or integer number. [numbers.c:2876] (real?) scm_real_p [numbers.c:2884] (rational? x) Return #t if X is a rational number, #f else. Note that the set of integer values forms a subset of the set of rational numbers, i. e. the predicate will also be fulfilled if X is an integer number. [numbers.c:2891] (integer? x) Return #t if X is an integer number, #f else. [numbers.c:2911] (inexact? x) Return #t if X is an inexact number, #f else. [numbers.c:2935] (> x y) Return #t if the list of parameters is monotonically increasing. [numbers.c:3057] (<= x y) Return #t if the list of parameters is monotonically non-decreasing. [numbers.c:3068] (>= x y) Return #t if the list of parameters is monotonically non-increasing. [numbers.c:3079] ($expt z1 z2) [numbers.c:3910] ($atan2 z1 z2) [numbers.c:3922] (make-rectangular real imaginary) Return a complex number constructed of the given REAL and IMAGINARY parts. [numbers.c:3935] (make-polar z1 z2) Return the complex number Z1 * e^(i * Z2). [numbers.c:3948] (inexact->exact z) Returns an exact number that is numerically closest to Z. [numbers.c:4061] (entity? obj) [objects.c:358] (operator? obj) [objects.c:367] (set-object-procedure! obj proc) [objects.c:378] (make-class-object metaclass layout) [objects.c:436] (make-subclass-object class layout) [objects.c:450] (object-properties obj) @deffnx primitive procedure-properties obj Return @var{obj}'s property list. [objprop.c:61] (set-object-properties! obj plist) @deffnx primitive set-procedure-properties! obj alist Set @var{obj}'s property list to @var{alist}. [objprop.c:72] (object-property obj key) @deffnx primitive procedure-property obj key Return the property of @var{obj} with name @var{key}. [objprop.c:84] (set-object-property! obj key val) @deffnx primitive set-procedure-property! obj key value In @var{obj}'s property list, set the property named @var{key} to @var{value}. [objprop.c:97] (cons x y) Returns a newly allocated pair whose car is @var{x} and whose cdr is @var{y}. The pair is guaranteed to be different (in the sense of @code{eqv?}) from every previously existing object. [pairs.c:60] (pair? x) Returns @code{#t} if @var{x} is a pair; otherwise returns @code{#f}. [pairs.c:92] (set-car! pair value) Stores @var{value} in the car field of @var{pair}. The value returned by @code{set-car!} is unspecified. [pairs.c:103] (set-cdr! pair value) Stores @var{value} in the cdr field of @var{pair}. The value returned by @code{set-cdr!} is unspecified. [pairs.c:116] (char-ready? port) Returns @code{#t} if a character is ready on input @var{port} and returns @code{#f} otherwise. If @code{char-ready?} returns @code{#t} then the next @code{read-char} operation on @var{port} is guaranteed not to hang. If @var{port} is a file port at end of file then @code{char-ready?} returns @code{#t}. @footnote{@code{char-ready?} exists to make it possible for a program to accept characters from interactive ports without getting stuck waiting for input. Any input editors associated with such ports must make sure that characters whose existence has been asserted by @code{char-ready?} cannot be rubbed out. If @code{char-ready?} were to return @code{#f} at end of file, a port at end of file would be indistinguishable from an interactive port that has no ready characters.} [ports.c:239] (drain-input port) Drains @var{PORT}'s read buffers (including any pushed-back characters) and returns the contents as a single string. [ports.c:274] (current-input-port) Returns the current input port. This is the default port used by many input procedures. Initially, @code{current-input-port} returns the value of @code{???}. [ports.c:311] (current-output-port) Returns the current output port. This is the default port used by many output procedures. Initially, @code{current-output-port} returns the value of @code{???}. [ports.c:322] (current-error-port) Return the port to which errors and warnings should be sent (the @dfn{standard error} in Unix and C terminology). [ports.c:332] (current-load-port) Return the current-load-port. The load port is used internally by `primitive-load'. [ports.c:342] (set-current-input-port port) @deffnx primitive set-current-output-port port @deffnx primitive set-current-error-port port Change the ports returned by @code{current-input-port}, @code{current-output-port} and @code{current-error-port}, respectively, so that they use the supplied @var{port} for input or output. [ports.c:355] (set-current-output-port port) Set the current default output port to PORT. [ports.c:368] (set-current-error-port port) Set the current default error port to PORT. [ports.c:382] (port-revealed port) Returns the revealed count for @var{port}. [ports.c:521] (set-port-revealed! port rcount) Sets the revealed count for a port to a given value. The return value is unspecified. [ports.c:534] (port-mode port) Returns the port modes associated with the open port @var{port}. These will not necessarily be identical to the modes used when the port was opened, since modes such as \"append\" which are used only during port creation are not retained. [ports.c:577] (close-port port) Close the specified port object. Returns @code{#t} if it successfully closes a port or @code{#f} if it was already closed. An exception may be raised if an error occurs, for example when flushing buffered output. See also @ref{Ports and File Descriptors, close}, for a procedure which can close file descriptors. [ports.c:614] (close-input-port port) Close the specified input port object. The routine has no effect if the file has already been closed. An exception may be raised if an error occurs. The value returned is unspecified. See also @ref{Ports and File Descriptors, close}, for a procedure which can close file descriptors. [ports.c:642] (close-output-port port) Close the specified output port object. The routine has no effect if the file has already been closed. An exception may be raised if an error occurs. The value returned is unspecified. See also @ref{Ports and File Descriptors, close}, for a procedure which can close file descriptors. [ports.c:657] (close-all-ports-except ports) Close all open file ports used by the interpreter except for those supplied as arguments. This procedure is intended to be used before an exec call to close file descriptors which are not needed in the new process. [ports.c:672] (input-port? x) Returns @code{#t} if @var{x} is an input port, otherwise returns @code{#f}. Any object satisfying this predicate also satisfies @code{port?}. [ports.c:710] (output-port? x) Returns @code{#t} if @var{x} is an output port, otherwise returns @code{#f}. Any object satisfying this predicate also satisfies @code{port?}. [ports.c:723] (port-closed? port) Returns @code{#t} if @var{port} is closed or @code{#f} if it is open. [ports.c:736] (eof-object? x) Returns @code{#t} if @var{x} is an end-of-file object; otherwise returns @code{#f}. [ports.c:747] (force-output port) Flush the specified output port, or the current output port if @var{port} is omitted. The current output buffer contents are passed to the underlying port implementation (e.g., in the case of fports, the data will be written to the file and the output buffer will be cleared.) It has no effect on an unbuffered port. The return value is unspecified. [ports.c:761] (flush-all-ports) Equivalent to calling @code{force-output} on all open output ports. The return value is unspecified. [ports.c:779] (read-char port) Returns the next character available from @var{port}, updating @var{port} to point to the following character. If no more characters are available, an end-of-file object is returned. [ports.c:797] (peek-char port) Returns the next character available from @var{port}, @emph{without} updating @var{port} to point to the following character. If no more characters are available, an end-of-file object is returned.@footnote{The value returned by a call to @code{peek-char} is the same as the value that would have been returned by a call to @code{read-char} on the same port. The only difference is that the very next call to @code{read-char} or @code{peek-char} on that @var{port} will return the value returned by the preceding call to @code{peek-char}. In particular, a call to @code{peek-char} on an interactive port will hang waiting for input whenever a call to @code{read-char} would have hung.} [ports.c:1030] (unread-char cobj port) Place @var{char} in @var{port} so that it will be read by the next read operation. If called multiple times, the unread characters will be read again in last-in first-out order. If @var{port} is not supplied, the current input port is used. [ports.c:1051] (unread-string str port) Place the string @var{str} in @var{port} so that its characters will be read in subsequent read operations. If called multiple times, the unread characters will be read again in last-in first-out order. If @var{port} is not supplied, the current-input-port is used. [ports.c:1074] (seek object offset whence) Sets the current position of @var{fd/port} to the integer @var{offset}, which is interpreted according to the value of @var{whence}. One of the following variables should be supplied for @var{whence}: @defvar SEEK_SET Seek from the beginning of the file. @end defvar @defvar SEEK_CUR Seek from the current position. @end defvar @defvar SEEK_END Seek from the end of the file. @end defvar If @var{fd/port} is a file descriptor, the underlying system call is @code{lseek}. @var{port} may be a string port. The value returned is the new position in the file. This means that the current position of a port can be obtained using: @smalllisp (seek port 0 SEEK_CUR) @end smalllisp [ports.c:1110] (truncate-file object length) Truncates the object referred to by @var{obj} to at most @var{size} bytes. @var{obj} can be a string containing a file name or an integer file descriptor or a port. @var{size} may be omitted if @var{obj} is not a file name, in which case the truncation occurs at the current port. position. The return value is unspecified. [ports.c:1151] (port-line port) Return the current line number for PORT. [ports.c:1205] (set-port-line! port line) Set the current line number for PORT to LINE. [ports.c:1216] (port-column port) @deffnx primitive port-line [input-port] Return the current column number or line number of @var{input-port}, using the current input port if none is specified. If the number is unknown, the result is #f. Otherwise, the result is a 0-origin integer - i.e. the first character of the first line is line 0, column 0. (However, when you display a file position, for example in an error message, we recommand you add 1 to get 1-origin integers. This is because lines and column numbers traditionally start with 1, and that is what non-programmers will find most natural.) [ports.c:1237] (set-port-column! port column) @deffnx primitive set-port-column! [input-port] column Set the current column or line number of @var{input-port}, using the current input port if none is specified. [ports.c:1250] (port-filename port) Return the filename associated with @var{port}. This function returns the strings \"standard input\", \"standard output\" and \"standard error\"" when called on the current input, output and error ports respectively. [ports.c:1265] (set-port-filename! port filename) Change the filename associated with @var{port}, using the current input port if none is specified. Note that this does not change the port's source of data, but only the value that is returned by @code{port-filename} and reported in diagnostic output. [ports.c:1279] (%make-void-port mode) Create and return a new void port. A void port acts like /dev/null. The @var{mode} argument specifies the input/output modes for this port: see the documentation for @code{open-file} in @ref{File Ports}. [ports.c:1382] (pipe) Returns a newly created pipe: a pair of ports which are linked together on the local machine. The CAR is the input port and the CDR is the output port. Data written (and flushed) to the output port can be read from the input port. Pipes are commonly used for communication with a newly forked child process. The need to flush the output port can be avoided by making it unbuffered using @code{setvbuf}. Writes occur atomically provided the size of the data in bytes is not greater than the value of @code{PIPE_BUF} Note that the output port is likely to block if too much data (typically equal to @code{PIPE_BUF}) has been written but not yet read from the input port [posix.c:183] (getgroups) Returns a vector of integers representing the current supplimentary group IDs. [posix.c:203] (getpw user) Look up an entry in the user database. @var{obj} can be an integer, a string, or omitted, giving the behaviour of getpwuid, getpwnam or getpwent respectively. [posix.c:242] (setpw arg) If called with a true argument, initialize or reset the password data stream. Otherwise, close the stream. The @code{setpwent} and @code{endpwent} procedures are implemented on top of this. [posix.c:296] (getgr name) Look up an entry in the group database. @var{obj} can be an integer, a string, or omitted, giving the behaviour of getgrgid, getgrnam or getgrent respectively. [posix.c:315] (setgr arg) If called with a true argument, initialize or reset the group data stream. Otherwise, close the stream. The @code{setgrent} and @code{endgrent} procedures are implemented on top of this. [posix.c:356] (kill pid sig) Sends a signal to the specified process or group of processes. @var{pid} specifies the processes to which the signal is sent: @table @r @item @var{pid} greater than 0 The process whose identifier is @var{pid}. @item @var{pid} equal to 0 All processes in the current process group. @item @var{pid} less than -1 The process group whose identifier is -@var{pid} @item @var{pid} equal to -1 If the process is privileged, all processes except for some special system processes. Otherwise, all processes with the current effective user ID. @end table @var{sig} should be specified using a variable corresponding to the Unix symbolic name, e.g., @defvar SIGHUP Hang-up signal. @end defvar @defvar SIGINT Interrupt signal. @end defvar [posix.c:392] (waitpid pid options) This procedure collects status information from a child process which has terminated or (optionally) stopped. Normally it will suspend the calling process until this can be done. If more than one child process is eligible then one will be chosen by the operating system. The value of @var{pid} determines the behaviour: @table @r @item @var{pid} greater than 0 Request status information from the specified child process. @item @var{pid} equal to -1 or WAIT_ANY Request status information for any child process. @item @var{pid} equal to 0 or WAIT_MYPGRP Request status information for any child process in the current process group. @item @var{pid} less than -1 Request status information for any child process whose process group ID is -@var{PID}. @end table The @var{options} argument, if supplied, should be the bitwise OR of the values of zero or more of the following variables: @defvar WNOHANG Return immediately even if there are no child processes to be collected. @end defvar @defvar WUNTRACED Report status information for stopped processes as well as terminated processes. @end defvar The return value is a pair containing: @enumerate @item The process ID of the child process, or 0 if @code{WNOHANG} was specified and no process was collected. @item The integer status value. @end enumerate [posix.c:440] (status:exit-val status) Returns the exit status value, as would be set if a process ended normally through a call to @code{exit} or @code{_exit}, if any, otherwise @code{#f}. [posix.c:467] (status:term-sig status) Returns the signal number which terminated the process, if any, otherwise @code{#f}. [posix.c:487] (status:stop-sig status) Returns the signal number which stopped the process, if any, otherwise @code{#f}. [posix.c:505] (getppid) Returns an integer representing the process ID of the parent process. [posix.c:522] (getuid) Returns an integer representing the current real user ID. [posix.c:533] (getgid) Returns an integer representing the current real group ID. [posix.c:544] (geteuid) Returns an integer representing the current effective user ID. If the system does not support effective IDs, then the real ID is returned. @code{(feature? 'EIDs)} reports whether the system supports effective IDs. [posix.c:558] (getegid) Returns an integer representing the current effective group ID. If the system does not support effective IDs, then the real ID is returned. @code{(feature? 'EIDs)} reports whether the system supports effective IDs. [posix.c:576] (setuid id) Sets both the real and effective user IDs to the integer @var{id}, provided the process has appropriate privileges. The return value is unspecified. [posix.c:592] (setgid id) Sets both the real and effective group IDs to the integer @var{id}, provided the process has appropriate privileges. The return value is unspecified. [posix.c:606] (seteuid id) Sets the effective user ID to the integer @var{id}, provided the process has appropriate privileges. If effective IDs are not supported, the real ID is set instead -- @code{(feature? 'EIDs)} reports whether the system supports effective IDs. The return value is unspecified. [posix.c:622] (setegid id) Sets the effective group ID to the integer @var{id}, provided the process has appropriate privileges. If effective IDs are not supported, the real ID is set instead -- @code{(feature? 'EIDs)} reports whether the system supports effective IDs. The return value is unspecified. [posix.c:646] (getpgrp) Returns an integer representing the current process group ID. This is the POSIX definition, not BSD. [posix.c:668] (setpgid pid pgid) Move the process @var{pid} into the process group @var{pgid}. @var{pid} or @var{pgid} must be integers: they can be zero to indicate the ID of the current process. Fails on systems that do not support job control. The return value is unspecified. [posix.c:684] (setsid) Creates a new session. The current process becomes the session leader and is put in a new process group. The process will be detached from its controlling terminal if it has one. The return value is an integer representing the new process group ID. [posix.c:703] (ttyname port) Returns a string with the name of the serial terminal device underlying @var{port}. [posix.c:717] (ctermid) Returns a string containing the file name of the controlling terminal for the current process. [posix.c:740] (tcgetpgrp port) Returns the process group ID of the foreground process group associated with the terminal open on the file descriptor underlying @var{port}. If there is no foreground process group, the return value is a number greater than 1 that does not match the process group ID of any existing process group. This can happen if all of the processes in the job that was formerly the foreground job have terminated, and no other job has yet been moved into the foreground. [posix.c:762] (tcsetpgrp port pgid) Set the foreground process group ID for the terminal used by the file descriptor underlying @var{port} to the integer @var{pgid}. The calling process must be a member of the same session as @var{pgid} and must have the same controlling terminal. The return value is unspecified. [posix.c:786] (execl filename args) Executes the file named by @var{path} as a new process image. The remaining arguments are supplied to the process; from a C program they are accessable as the @code{argv} argument to @code{main}. Conventionally the first @var{arg} is the same as @var{path}. All arguments must be strings. If @var{arg} is missing, @var{path} is executed with a null argument list, which may have system-dependent side-effects. This procedure is currently implemented using the @code{execv} system call, but we call it @code{execl} because of its Scheme calling interface. [posix.c:844] (execlp filename args) Similar to @code{execl}, however if @var{filename} does not contain a slash then the file to execute will be located by searching the directories listed in the @code{PATH} environment variable. This procedure is currently implemented using the @code{execvp} system call, but we call it @code{execlp} because of its Scheme calling interface. [posix.c:865] (execle filename env args) Similar to @code{execl}, but the environment of the new process is specified by @var{env}, which must be a list of strings as returned by the @code{environ} procedure. This procedure is currently implemented using the @code{execve} system call, but we call it @code{execle} because of its Scheme calling interface. [posix.c:919] (primitive-fork) Creates a new \"child\" process by duplicating the current \"parent\" process. In the child the return value is 0. In the parent the return value is the integer process ID of the child. This procedure has been renamed from @code{fork} to avoid a naming conflict with the scsh fork. [posix.c:943] (uname) Returns an object with some information about the computer system the program is running on. [posix.c:958] (environ env) If @var{env} is omitted, returns the current environment as a list of strings. Otherwise it sets the current environment, which is also the default environment for child processes, to the supplied list of strings. Each member of @var{env} should be of the form @code{NAME=VALUE} and values of @code{NAME} should not be duplicated. If @var{env} is supplied then the return value is unspecified. [posix.c:987] (tmpnam) Create a new file in the file system with a unique name. The return value is the name of the new file. This function is implemented with the @code{tmpnam} function in the system libraries. [posix.c:1023] (utime pathname actime modtime) @code{utime} sets the access and modification times for the file named by @var{path}. If @var{actime} or @var{modtime} is not supplied, then the current time is used. @var{actime} and @var{modtime} must be integer time values as returned by the @code{current-time} procedure. E.g., @smalllisp (utime \"foo\" (- (current-time) 3600)) @end smalllisp will set the access time to one hour in the past and the modification time to the current time. [posix.c:1047] (access? path how) Returns @code{#t} if @var{path} corresponds to an existing file and the current process has the type of access specified by @var{how}, otherwise @code{#f}. @var{how} should be specified using the values of the variables listed below. Multiple values can be combined using a bitwise or, in which case @code{#t} will only be returned if all accesses are granted. Permissions are checked using the real id of the current process, not the effective id, although it's the effective id which determines whether the access would actually be granted. @defvar R_OK test for read permission. @end defvar @defvar W_OK test for write permission. @end defvar @defvar X_OK test for execute permission. @end defvar @defvar F_OK test for existence of the file. @end defvar [posix.c:1096] (getpid) Returns an integer representing the current process ID. [posix.c:1112] (putenv str) Modifies the environment of the current process, which is also the default environment inherited by child processes. If @var{string} is of the form @code{NAME=VALUE} then it will be written directly into the environment, replacing any existing environment string with name matching @code{NAME}. If @var{string} does not contain an equal sign, then any existing string with name matching @var{string} will be removed. The return value is unspecified. [posix.c:1129] (setlocale category locale) If @var{locale} is omitted, returns the current value of the specified locale category as a system-dependent string. @var{category} should be specified using the values @code{LC_COLLATE}, @code{LC_ALL} etc. Otherwise the specified locale category is set to the string @var{locale} and the new value is returned as a system-dependent string. If @var{locale} is an empty string, the locale will be set using envirionment variables. [posix.c:1160] (mknod path type perms dev) Creates a new special file, such as a file corresponding to a device. @var{path} specifies the name of the file. @var{type} should be one of the following symbols: regular, directory, symlink, block-special, char-special, fifo, or socket. @var{perms} (an integer) specifies the file permissions. @var{dev} (an integer) specifies which device the special file refers to. Its exact interpretation depends on the kind of special file being created. E.g., @example (mknod \"/dev/fd0\" 'block-special #o660 (+ (* 2 256) 2))" @end example The return value is unspecified. [posix.c:1201] (nice incr) Increment the priority of the current process by @var{incr}. A higher priority value means that the process runs less often. The return value is unspecified. [posix.c:1246] (sync) Flush the operating system disk buffers. The return value is unspecified. [posix.c:1261] (print-options-interface setting) [print.c:135] (simple-format destination message args) Write MESSAGE to DESTINATION, defaulting to `current-output-port'. MESSAGE can contain ~A (was %s) and ~S (was %S) escapes. When printed, the escapes are replaced with corresponding members of ARGS: ~A formats using `display' and ~S formats using `write'. If DESTINATION is #t, then use the `current-output-port', if DESTINATION is #f, then return a string containing the formatted text. Does not add a trailing newline. [print.c:952] (newline port) Send a newline to PORT. [print.c:1007] (write-char chr port) Send character CHR to PORT. [print.c:1022] (port-with-print-state port pstate) [print.c:1075] (get-print-state port) [print.c:1089] (procedure-properties proc) Return @var{obj}'s property list. [procprop.c:167] (set-procedure-properties! proc new_val) Set @var{obj}'s property list to @var{alist}. [procprop.c:180] (procedure-property p k) Return the property of @var{obj} with name @var{key}. [procprop.c:193] (set-procedure-property! p k v) In @var{obj}'s property list, set the property named @var{key} to @var{value}. [procprop.c:216] (procedure? obj) [procs.c:182] (closure? obj) [procs.c:208] (thunk? obj) [procs.c:217] (procedure-documentation proc) Return the documentation string associated with @code{proc}. By convention, if a procedure contains more than one expression and the first expression is a string constant, that string is assumed to contain documentation for that procedure. [procs.c:268] (procedure-with-setter? obj) [procs.c:304] (make-procedure-with-setter procedure setter) [procs.c:313] (procedure proc) [procs.c:331] (array-fill! ra fill) Stores @var{fill} in every element of @var{array}. The value returned is unspecified. [ramap.c:456] (array-copy-in-order!) scm_array_copy_x [ramap.c:809] (array-copy! src dst) Copies every element from vector or array @var{source} to the corresponding element of @var{destination}. @var{destination} must have the same rank as @var{source}, and be at least as large in each dimension. The order is unspecified. [ramap.c:817] (array-map-in-order!) scm_array_map_x [ramap.c:1491] (array-map! ra0 proc lra) @var{array1}, @dots{} must have the same number of dimensions as @var{array0} and have a range for each index which includes the range for the corresponding index in @var{array0}. @var{proc} is applied to each tuple of elements of @var{array1} @dots{} and the result is stored as the corresponding element in @var{array0}. The value returned is unspecified. The order of application is unspecified. [ramap.c:1501] (array-for-each proc ra0 lra) @var{proc} is applied to each tuple of elements of @var{array0} @dots{} in row-major order. The value returned is unspecified. [ramap.c:1648] (array-index-map! ra proc) applies @var{proc} to the indices of each element of @var{array} in turn, storing the result in the corresponding element. The value returned and the order of application are unspecified. One can implement @var{array-indexes} as @example (define (array-indexes array) (let ((ra (apply make-array #f (array-shape array)))) (array-index-map! ra (lambda x x)) ra)) @end example Another example: @example (define (apl:index-generator n) (let ((v (make-uniform-vector n 1))) (array-index-map! v (lambda (i) i)) v)) @end example [ramap.c:1676] (random n state) Return a number in [0,N). Accepts a positive integer or real n and returns a number of the same type between zero (inclusive) and N (exclusive). The values returned have a uniform distribution. The optional argument STATE must be of the type produced by `seed->random-state'. It defaults to the value of the variable *random-state*. This object is used to maintain the state of the pseudo-random-number generator and is altered as a side effect of the random operation. [random.c:367] (copy-random-state state) Return a copy of the random state STATE. [random.c:390] (seed->random-state seed) Return a new random state using SEED. [random.c:402] (random:uniform state) Returns a uniformly distributed inexact real random number in [0,1). [random.c:415] (random:normal state) Returns an inexact real in a normal distribution. The distribution used has mean 0 and standard deviation 1. For a normal distribution with mean m and standard deviation d use @code{(+ m (* d (random:normal)))}. [random.c:431] (random:solid-sphere! v state) Fills vect with inexact real random numbers the sum of whose squares is less than 1.0. Thinking of vect as coordinates in space of dimension n = (vector-length vect), the coordinates are uniformly distributed within the unit n-shere. The sum of the squares of the numbers is returned. [random.c:488] (random:hollow-sphere! v state) Fills vect with inexact real random numbers the sum of whose squares is equal to 1.0. Thinking of vect as coordinates in space of dimension n = (vector-length vect), the coordinates are uniformly distributed over the surface of the unit n-shere. [random.c:512] (random:normal-vector! v state) Fills vect with inexact real random numbers that are independent and standard normally distributed (i.e., with mean 0 and variance 1). [random.c:531] (random:exp state) Returns an inexact real in an exponential distribution with mean 1. For an exponential distribution with mean u use (* u (random:exp)). [random.c:556] (read-options-interface setting) [read.c:80] (read port) [read.c:98] (read-hash-extend chr proc) [read.c:707] (regexp? x) Return @code{#t} if @var{obj} is a compiled regular expression, or @code{#f} otherwise. [regex-posix.c:138] (make-regexp pat flags) Compile the regular expression described by @var{str}, and return the compiled regexp structure. If @var{str} does not describe a legal regular expression, @code{make-regexp} throws a @code{regular-expression-syntax} error. The @var{flag} arguments change the behavior of the compiled regexp. The following flags may be supplied: @table @code @item regexp/icase Consider uppercase and lowercase letters to be the same when matching. @item regexp/newline If a newline appears in the target string, then permit the @samp{^} and @samp{$} operators to match immediately after or immediately before the newline, respectively. Also, the @samp{.} and @samp{[^...]} operators will never match a newline character. The intent of this flag is to treat the target string as a buffer containing many lines of text, and the regular expression as a pattern that may match a single one of those lines. @item regexp/basic Compile a basic (``obsolete'') regexp instead of the extended (``modern'') regexps that are the default. Basic regexps do not consider @samp{|}, @samp{+} or @samp{?} to be special characters, and require the @samp{@{...@}} and @samp{(...)} metacharacters to be backslash-escaped (@pxref{Backslash Escapes}). There are several other differences between basic and extended regular expressions, but these are the most significant. @item regexp/extended Compile an extended regular expression rather than a basic regexp. This is the default behavior; this flag will not usually be needed. If a call to @code{make-regexp} includes both @code{regexp/basic} and @code{regexp/extended} flags, the one which comes last will override the earlier one. @end table [regex-posix.c:178] (regexp-exec rx str start flags) Match the compiled regular expression @var{regexp} against @code{str}. If the optional integer @var{start} argument is provided, begin matching from that position in the string. Return a match structure describing the results of the match, or @code{#f} if no match could be found. [regex-posix.c:225] (call-with-dynamic-root thunk handler) Evaluate @var{(thunk)} in a new dynamic context, returning its value. If an error occurs during evaluation, apply @var{handler} to the arguments to the throw, just as @code{throw} would. If this happens, @var{handler} is called outside the scope of the new root -- it is called in the same dynamic context in which @code{call-with-dynamic-root} was evaluated. If @var{thunk} captures a continuation, the continuation is rooted at the call to @var{thunk}. In particular, the call to @code{call-with-dynamic-root} is not captured. Therefore, @code{call-with-dynamic-root} always returns at most one time. Before calling @var{thunk}, the dynamic-wind chain is un-wound back to the root and a new chain started for @var{thunk}. Therefore, this call may not do what you expect: @example ;; Almost certainly a bug: (with-output-to-port some-port (lambda () (call-with-dynamic-root (lambda () (display 'fnord) (newline)) (lambda (errcode) errcode)))) @end example The problem is, on what port will @samp{fnord } be displayed? You might expect that because of the @code{with-output-to-port} that it will be displayed on the port bound to @code{some-port}. But it probably won't -- before evaluating the thunk, dynamic winds are unwound, including those created by @code{with-output-to-port}. So, the standard output port will have been re-set to its default value before @code{display} is evaluated. (This function was added to Guile mostly to help calls to functions in C libraries that can not tolerate non-local exits or calls that return multiple times. If such functions call back to the interpreter, it should be under a new dynamic root.) [root.c:373] (dynamic-root) Return an object representing the current dynamic root. These objects are only useful for comparison using @code{eq?}. They are currently represented as numbers, but your code should in no way depend on this. [root.c:386] (sigaction signum handler flags) Install or report the signal handler for a specified signal. @var{signum} is the signal number, which can be specified using the value of variables such as @code{SIGINT}. If @var{action} is omitted, @code{sigaction} returns a pair: the CAR is the current signal hander, which will be either an integer with the value @code{SIG_DFL} (default action) or @code{SIG_IGN} (ignore), or the Scheme procedure which handles the signal, or @code{#f} if a non-Scheme procedure handles the signal. The CDR contains the current @code{sigaction} flags for the handler. If @var{action} is provided, it is installed as the new handler for @var{signum}. @var{action} can be a Scheme procedure taking one argument, or the value of @code{SIG_DFL} (default action) or @code{SIG_IGN} (ignore), or @code{#f} to restore whatever signal handler was installed before @code{sigaction} was first used. Flags can optionally be specified for the new handler (@code{SA_RESTART} will always be added if it's available and the system is using restartable system calls.) The return value is a pair with information about the old handler as described above. This interface does not provide access to the \"signal blocking" facility. Maybe this is not needed, since the thread support may provide solutions to the problem of consistent access to data structures. [scmsigs.c:198] (restore-signals) Return all signal handlers to the values they had before any call to @code{sigaction} was made. The return value is unspecified. [scmsigs.c:357] (alarm i) Set a timer to raise a @code{SIGALRM} signal after the specified number of seconds (an integer). It's advisable to install a signal handler for @code{SIGALRM} beforehand, since the default action is to terminate the process. The return value indicates the time remaining for the previous alarm, if any. The new value replaces the previous alarm. If there was no previous alarm, the return value is zero. [scmsigs.c:396] (pause) Pause the current process (thread?) until a signal arrives whose action is to either terminate the current process or invoke a handler procedure. The return value is unspecified. [scmsigs.c:411] (sleep i) Wait for the given number of seconds (an integer) or until a signal arrives. The return value is zero if the time elapses or the number of seconds remaining otherwise. [scmsigs.c:424] (usleep i) Sleep for I microseconds. `usleep' is not available on all platforms. [scmsigs.c:442] (raise sig) Sends a specified signal @var{sig} to the current process, where @var{sig} is as described for the kill procedure. [scmsigs.c:472] (system cmd) Executes @var{cmd} using the operating system's \"command processor\". Under Unix this is usually the default shell @code{sh}. The value returned is @var{cmd}'s exit status as returned by @code{waitpid}, which can be interpreted using the functions above. If @code{system} is called without arguments, it returns a boolean indicating whether the command processor is available. [simpos.c:73] (getenv nam) Looks up the string @var{name} in the current environment. The return value is @code{#f} unless a string of the form @code{NAME=VALUE} is found, in which case the string @code{VALUE} is returned. [simpos.c:103] (primitive-exit status) Terminate the current process without unwinding the Scheme stack. This is would typically be useful after a fork. The exit status is @var{status} if supplied, otherwise zero. [simpos.c:119] (htons in) Returns a new integer from @var{value} by converting from host to network order. @var{value} must be within the range of a C unsigned short integer. [socket.c:78] (ntohs in) Returns a new integer from @var{value} by converting from network to host order. @var{value} must be within the range of a C unsigned short integer. [socket.c:95] (htonl in) Returns a new integer from @var{value} by converting from host to network order. @var{value} must be within the range of a C unsigned long integer. [socket.c:112] (ntohl in) Returns a new integer from @var{value} by converting from network to host order. @var{value} must be within the range of a C unsigned long integer. [socket.c:124] (socket family style proto) Returns a new socket port of the type specified by @var{family}, @var{style} and @var{protocol}. All three parameters are integers. Typical values for @var{family} are the values of @code{AF_UNIX} and @code{AF_INET}. Typical values for @var{style} are the values of @code{SOCK_STREAM}, @code{SOCK_DGRAM} and @code{SOCK_RAW}. @var{protocol} can be obtained from a protocol name using @code{getprotobyname}. A value of zero specifies the default protocol, which is usually right. A single socket port cannot by used for communication until it has been connected to another socket. [socket.c:158] (socketpair family style proto) Returns a pair of connected (but unnamed) socket ports of the type specified by @var{family}, @var{style} and @var{protocol}. Many systems support only socket pairs of the @code{AF_UNIX} family. Zero is likely to be the only meaningful value for @var{protocol}. [socket.c:182] (getsockopt sock level optname) Returns the value of a particular socket option for the socket port @var{socket}. @var{level} is an integer code for type of option being requested, e.g., @code{SOL_SOCKET} for socket-level options. @var{optname} is an integer code for the option required and should be specified using one of the symbols @code{SO_DEBUG}, @code{SO_REUSEADDR} etc. The returned value is typically an integer but @code{SO_LINGER} returns a pair of integers. [socket.c:215] (setsockopt sock level optname value) Sets the value of a particular socket option for the socket port @var{socket}. @var{level} is an integer code for type of option being set, e.g., @code{SOL_SOCKET} for socket-level options. @var{optname} is an integer code for the option to set and should be specified using one of the symbols @code{SO_DEBUG}, @code{SO_REUSEADDR} etc. @var{value} is the value to which the option should be set. For most options this must be an integer, but for @code{SO_LINGER} it must be a pair. The return value is unspecified. [socket.c:286] (shutdown sock how) Sockets can be closed simply by using @code{close-port}. The @code{shutdown} procedure allows reception or tranmission on a connection to be shut down individually, according to the parameter @var{how}: @table @asis @item 0 Stop receiving data for this socket. If further data arrives, reject it. @item 1 Stop trying to transmit data from this socket. Discard any data waiting to be sent. Stop looking for acknowledgement of data already sent; don't retransmit it if it is lost. @item 2 Stop both reception and transmission. @end table The return value is unspecified. [socket.c:373] (connect sock fam address args) Initiates a connection from @var{socket} to the address specified by @var{address} and possibly @var{arg @dots{}}. The format required for @var{address} and @var{arg} @dots{} depends on the family of the socket. For a socket of family @code{AF_UNIX}, only @code{address} is specified and must be a string with the filename where the socket is to be created. For a socket of family @code{AF_INET}, @code{address} must be an integer Internet host address and @var{arg} @dots{} must be a single integer port number. The return value is unspecified. [socket.c:456] (bind sock fam address args) Assigns an address to the socket port @var{socket}. Generally this only needs to be done for server sockets, so they know where to look for incoming connections. A socket without an address will be assigned one automatically when it starts communicating. The format of @var{address} and @var{ARG} @dots{} depends on the family of the socket. For a socket of family @code{AF_UNIX}, only @var{address} is specified and must be a string with the filename where the socket is to be created. For a socket of family @code{AF_INET}, @var{address} must be an integer Internet host address and @var{arg} @dots{} must be a single integer port number. The values of the following variables can also be used for @var{address}: @defvar INADDR_ANY Allow connections from any address. @end defvar @defvar INADDR_LOOPBACK The address of the local host using the loopback device. @end defvar @defvar INADDR_BROADCAST The broadcast address on the local network. @end defvar @defvar INADDR_NONE No address. @end defvar The return value is unspecified. [socket.c:503] (listen sock backlog) This procedure enables @var{socket} to accept connection requests. @var{backlog} is an integer specifying the maximum length of the queue for pending connections. If the queue fills, new clients will fail to connect until the server calls @code{accept} to accept a connection from the queue. The return value is unspecified. [socket.c:531] (accept sock) Accepts a connection on a bound, listening socket @var{socket}. If there are no pending connections in the queue, it waits until one is available unless the non-blocking option has been set on the socket. The return value is a pair in which the CAR is a new socket port for the connection and the CDR is an object with address information about the client which initiated the connection. If the address is not available then the CDR will be an empty vector. @var{socket} does not become part of the connection and will continue to accept new requests. [socket.c:612] (getsockname sock) Returns the address of @var{socket}, in the same form as the object returned by @code{accept}. On many systems the address of a socket in the @code{AF_FILE} namespace cannot be read. [socket.c:640] (getpeername sock) Returns the address of the socket that the socket @var{socket} is connected to, in the same form as the object returned by @code{accept}. On many systems the address of a socket in the @code{AF_FILE} namespace cannot be read. [socket.c:665] (recv! sock buf flags) Receives data from the socket port @var{socket}. @var{socket} must already be bound to the address from which data is to be received. @var{buf} is a string into which the data will be written. The size of @var{buf} limits the amount of data which can be received: in the case of packet protocols, if a packet larger than this limit is encountered then some data will be irrevocably lost. The optional @var{flags} argument is a value or bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc. The value returned is the number of bytes read from the socket. Note that the data is read directly from the socket file descriptor:any unread buffered port data is ignored. [socket.c:697] (send sock message flags) Transmits the string @var{message} on the socket port @var{socket}. @var{socket} must already be bound to a destination address. The value returned is the number of bytes transmitted -- it's possible for this to be less than the length of @var{message} if the socket is set to be non-blocking. The optional @var{flags} argument is a value or bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc. Note that the data is written directly to the socket file descriptor: any unflushed buffered port data is ignored. [socket.c:726] (recvfrom! sock buf flags start end) Returns data from the socket port @var{socket} and also information about where the data was received from. @var{socket} must already be bound to the address from which data is to be received. @code{buf}, is a string into which the data will be written. The size of @var{buf} limits the amount of data which can be received: in the case of packet protocols, if a packet larger than this limit is encountered then some data will be irrevocably lost. The optional @var{flags} argument is a value or bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc. The value returned is a pair: the CAR is the number of bytes read from the socket and the CDR an address object in the same form as returned by @code{accept}. The @var{start} and @var{end} arguments specify a substring of @var{buf} to which the data should be written. Note that the data is read directly from the socket file descriptor: any unread buffered port data is ignored. [socket.c:764] (sendto sock message fam address args_and_flags) Transmits the string @var{message} on the socket port @var{socket}. The destination address is specified using the @var{family}, @var{address} and @var{arg} arguments, in a similar way to the @code{connect} procedure. The value returned is the number of bytes transmitted -- it's possible for this to be less than the length of @var{message} if the socket is set to be non-blocking. The optional @var{flags} argument is a value or bitwise OR of MSG_OOB, MSG_PEEK, MSG_DONTROUTE etc. Note that the data is written directly to the socket file descriptor: any unflushed buffered port data is ignored. [socket.c:833] (restricted-vector-sort! vec less startpos endpos) [sort.c:419] (sorted? items less) [sort.c:460] (merge alist blist less) [sort.c:540] (merge! alist blist less) [sort.c:647] (sort! items less) [sort.c:719] (sort items less) [sort.c:751] (stable-sort! items less) [sort.c:842] (stable-sort items less) [sort.c:880] (sort-list! items less) [sort.c:923] (sort-list items less) [sort.c:936] (source-properties obj) [srcprop.c:167] (set-source-properties! obj plist) [srcprop.c:189] (source-property obj key) [srcprop.c:208] (set-source-property! obj key datum) [srcprop.c:240] (stack? obj) Return @code{#t} if @var{obj} is a calling stack. [stacks.c:406] (make-stack obj args) [stacks.c:415] (stack-id stack) Return the identifier given to @var{stack} by @code{start-stack}. [stacks.c:506] (stack-ref stack i) [stacks.c:542] (stack-length stack) [stacks.c:556] (frame? obj) [stacks.c:569] (last-stack-frame obj) [stacks.c:578] (frame-number frame) [stacks.c:619] (frame-source frame) [stacks.c:629] (frame-procedure frame) [stacks.c:639] (frame-arguments frame) [stacks.c:651] (frame-previous frame) [stacks.c:661] (frame-next frame) [stacks.c:676] (frame-real? frame) [stacks.c:691] (frame-procedure? frame) [stacks.c:701] (frame-evaluating-args? frame) [stacks.c:711] (frame-overflow? frame) [stacks.c:721] (get-internal-real-time) Returns the number of time units since the interpreter was started. [stime.c:136] (times) Returns an object with information about real and processor time. The following procedures accept such an object as an argument and return a selected component: @table @code @item tms:clock The current real time, expressed as time units relative to an arbitrary base. @item tms:utime The CPU time units used by the calling process. @item tms:stime The CPU time units used by the system on behalf of the calling process. @item tms:cutime The CPU time units used by terminated child processes of the calling process, whose status has been collected (e.g., using @code{waitpid}). @item tms:cstime Similarly, the CPU times units used by the system on behalf of terminated child processes. @end table [stime.c:178] (get-internal-run-time) Returns the number of time units of processor time used by the interpreter. Both \"system\" and \"user\" time are included but subprocesses are not. [stime.c:203] (current-time) Returns the number of seconds since 1970-01-01 00:00:00 UTC, excludingleap seconds. [stime.c:212] (gettimeofday) Returns a pair containing the number of seconds and microseconds since 1970-01-01 00:00:00 UTC, excluding leap seconds. Note: whether true microsecond resolution is available depends on the operating system. [stime.c:229] (localtime time zone) Returns an object representing the broken down components of @var{time}, an integer like the one returned by @code{current-time}. The time zone for the calculation is optionally specified by @var{zone} (a string), otherwise the @code{TZ} environment variable or the system default is used. [stime.c:330] (gmtime time) Returns an object representing the broken down components of @var{time}, an integer like the one returned by @code{current-time}. The values are calculated for UTC. [stime.c:402] (mktime sbd_time zone) @var{bd-time} is an object representing broken down time and @code{zone} is an optional time zone specifier (otherwise the TZ environment variable or the system default is used). Returns a pair: the CAR is a corresponding integer time value like that returned by @code{current-time}; the CDR is a broken down time object, similar to as @var{bd-time} but with normalized values. [stime.c:464] (tzset) Initialize the timezone from the TZ environment variable or the system default. It's not usually necessary to call this procedure since it's done automatically by other procedures that depend on the timezone. [stime.c:537] (strftime format stime) Formats a time specification @var{time} using @var{template}. @var{time} is an object with time components in the form returned by @code{localtime} or @code{gmtime}. @var{template} is a string which can include formatting specifications introduced by a @code{%} character. The formatting of month and day names is dependent on the current locale. The value returned is the formatted string. @xref{Formatting Date and Time, , , libc, The GNU C Library Reference Manual}.) [stime.c:554] (strptime format string) Performs the reverse action to @code{strftime}, parsing @var{string} according to the specification supplied in @var{template}. The interpretation of month and day names is dependent on the current locale. The value returned is a pair. The CAR has an object with time components in the form returned by @code{localtime} or @code{gmtime}, but the time zone components are not usefully set. The CDR reports the number of characters from @var{string} which vwere used for the conversion. [stime.c:638] (string? obj) Returns #t iff OBJ is a string, else returns #f. [strings.c:60] (read-only-string? x) Return true if OBJ can be read as a string, This illustrates the difference between @code{string?} and @code{read-only-string?}: @example (string? \"a string\") @result{} #t (string? 'a-symbol) @result{} #f (read-only-string? \"a string\") @result{} #t (read-only-string? 'a-symbol) @result{} #t @end example [strings.c:77] (list->string) scm_string [strings.c:84] (string chrs) Returns a newly allocated string composed of the arguments, CHRS. [strings.c:88] (make-string k chr) Returns a newly allocated string of length K. If CHR is given, then all elements of the string are initialized to CHR, otherwise the contents of the STRING are unspecified. [strings.c:218] (string-length string) Returns the number of characters in STRING [strings.c:241] (string-ref str k) Returns character K of STR using zero-origin indexing. K must be a valid index of STR. [strings.c:252] (string-set! str k chr) Stores CHR in element K of STRING and returns an unspecified value. K must be a valid index of STR. [strings.c:267] (substring str start end) Returns a newly allocated string formed from the characters of STR beginning with index START (inclusive) and ending with index END (exclusive). STR must be a string, START and END must be exact integers satisfying: 0 <= START <= END <= (string-length STR). [strings.c:286] (string-append args) Returns a newly allocated string whose characters form the concatenation of the given strings, ARGS. [strings.c:304] (make-shared-substring str frm to) Return a shared substring of @var{str}. The semantics are the same as for the @code{substring} function: the shared substring returned includes all of the text from @var{str} between indexes @var{start} (inclusive) and @var{end} (exclusive). If @var{end} is omitted, it defaults to the end of @var{str}. The shared substring returned by @code{make-shared-substring} occupies the same storage space as @var{str}. [strings.c:336] (string-index str chr frm to) Return the index of the first occurrence of @var{chr} in @var{str}. The optional integer arguments @var{frm} and @var{to} limit the search to a portion of the string. This procedure essentially implements the @code{index} or @code{strchr} functions from the C library. (qdocs:) Returns the index of @var{char} in @var{str}, or @code{#f} if the @var{char} isn't in @var{str}. If @var{frm} is given and not @code{#f}, it is used as the starting index; if @var{to} is given and not @var{#f}, it is used as the ending index (exclusive). @example (string-index "weiner" #\e) @result{} 1 (string-index "weiner" #\e 2) @result{} 4 (string-index "weiner" #\e 2 4) @result{} #f @end example [strop.c:121] (string-rindex str chr frm to) Like @code{string-index}, but search from the right of the string rather than from the left. This procedure essentially implements the @code{rindex} or @code{strrchr} functions from the C library. (qdocs:) The same as @code{string-index}, except it gives the rightmost occurance of @var{char} in the range [@var{frm}, @var{to}-1], which defaults to the entire string. @example (string-rindex "weiner" #\e) @result{} 4 (string-rindex "weiner" #\e 2 4) @result{} #f (string-rindex "weiner" #\e 2 5) @result{} 4 @end example [strop.c:152] (substring-move-left!) scm_substring_move_x [strop.c:169] (substring-move-right!) scm_substring_move_x [strop.c:170] (substring-move! str1 start1 end1 str2 start2) Copy the substring of @var{str1} bounded by @var{start1} and @var{end1} into @var{str2} beginning at position @var{end2}. @code{substring-move-right!} begins copying from the rightmost character and moves left, and @code{substring-move-left!} copies from the leftmost character moving right. It is useful to have two functions that copy in different directions so that substrings can be copied back and forth within a single string. If you wish to copy text from the left-hand side of a string to the right-hand side of the same string, and the source and destination overlap, you must be careful to copy the rightmost characters of the text first, to avoid clobbering your data. Hence, when @var{str1} and @var{str2} are the same string, you should use @code{substring-move-right!} when moving text from left to right, and @code{substring-move-left!} otherwise. If @code{str1} and @samp{str2} are different strings, it does not matter which function you use. [strop.c:242] (substring-fill! str start end fill) Change every character in @var{str} between @var{start} and @var{end} to @var{fill-char}. (qdocs:) Destructively fills @var{str}, from @var{start} to @var{end}, with @var{fill}. @example (define y \"abcdefg\") (substring-fill! y 1 3 #\r) y @result{} \"arrdefg" @end example [strop.c:278] (string-null? str) Return @code{#t} if @var{str}'s length is nonzero, and @code{#f} otherwise. (qdocs:) Returns @code{#t} if @var{str} is empty, else returns @code{#f}. @example (string-null? \"\") @result{} #t (string-null? y) @result{} #f @end example [strop.c:305] (string->list str) @samp{String->list} returns a newly allocated list of the characters that make up the given string. @samp{List->string} returns a newly allocated string formed from the characters in the list @var{list}, which must be a list of characters. @samp{String->list} and @samp{list->string} are inverses so far as @samp{equal?} is concerned. (r5rs) [strop.c:321] (string-copy str) Returns a newly allocated copy of the given @var{string}. (r5rs) [strop.c:338] (string-fill! str chr) Stores @var{char} in every element of the given @var{string} and returns an unspecified value. (r5rs) [strop.c:350] (string-upcase! v) Destructively upcase every character in @code{str}. (qdocs:) Converts each element in @var{str} to upper case. @example (string-upcase! y) @result{} \"ARRDEFG\" y @result{} \"ARRDEFG" @end example [strop.c:371] (string-upcase str) Upcase every character in @code{str}. [strop.c:395] (string-downcase! v) Destructively downcase every character in @code{str}. (qdocs:) Converts each element in @var{str} to lower case. @example y @result{} \"ARRDEFG\" (string-downcase! y) @result{} \"arrdefg\" y @result{} \"arrdefg" @end example [strop.c:413] (string-downcase str) Downcase every character in @code{str}. [strop.c:436] (string-capitalize! str) Destructively capitalize every character in @code{str}. [strop.c:446] (string-capitalize str) Capitalize every character in @code{str}. [strop.c:471] (string-ci->symbol str) Return the symbol whose name is @var{str}, downcased in necessary(???). [strop.c:481] (string=? s1 s2) Lexicographic equality predicate; Returns @t{#t} if the two strings are the same length and contain the same characters in the same positions, otherwise returns @t{#f}. (r5rs) @samp{String-ci=?} treats upper and lower case letters as though they were the same character, but @samp{string=?} treats upper and lower case as distinct characters. [strorder.c:59] (string-ci=? s1 s2) Case-insensitive string equality predicate; returns @t{#t} if the two strings are the same length and their component characters match (ignoring case) at each position; otherwise returns @t{#f}. (r5rs) [strorder.c:85] (string? s1 s2) Lexicographic ordering predicate; returns @t{#t} if @var{s1} is lexicographically greater than @var{s2}. (r5rs) [strorder.c:153] (string>=? s1 s2) Lexicographic ordering predicate; returns @t{#t} if @var{s1} is lexicographically greater than or equal to @var{s2}. (r5rs) [strorder.c:163] (string-ci? s1 s2) Case insensitive lexicographic ordering predicate; returns @t{#t} if @var{s1} is lexicographically greater than @var{s2} regardless of case. (r5rs) [strorder.c:211] (string-ci>=? s1 s2) Case insensitive lexicographic ordering predicate; returns @t{#t} if @var{s1} is lexicographically greater than or equal to @var{s2} regardless of case. (r5rs) [strorder.c:222] (call-with-output-string proc) Calls the one-argument procedure @var{proc} with a newly created output port. When the function returns, the string composed of the characters written into the port is returned. [strports.c:306] (call-with-input-string str proc) Calls the one-argument procedure @var{proc} with a newly created input port from which @var{string}'s contents may be read. The value yielded by the @var{proc} is returned. [strports.c:348] (eval-string string) Evaluate @var{string} as the text representation of a Scheme form or forms, and return whatever value they produce. [strports.c:388] (make-struct-layout fields) Return a new structure layout object. @var{fields} must be a read-only string made up of pairs of characters strung together. The first character of each pair describes a field type, the second a field protection. Allowed types are 'p' for GC-protected Scheme data, 'u' for unprotected binary data, and 's' for fields that should point to the structure itself. Allowed protections are 'w' for mutable fields, 'r' for read-only fields, and 'o' for opaque fields. The last field protection specification may be capitalized to indicate that the field is a tail-array. [struct.c:78] (struct? x) Return #t iff @var{obj} is a structure object, else #f. [struct.c:239] (struct-vtable? x) Return #t iff obj is a vtable structure. [struct.c:248] (make-struct vtable tail_array_size init) Create a new structure. @var{type} must be a vtable structure (@xref{Vtables}). @var{tail-elts} must be a non-negative integer. If the layout specification indicated by @var{type} includes a tail-array, this is the number of elements allocated to that array. The @var{inits} are optional arguments describing how successive fields of the structure should be initialized. Only fields with protection 'r' or 'w' can be initialized -- fields of protection 's' are automatically initialized to point to the new structure itself; fields of protection 'o' can not be initialized by Scheme programs. [struct.c:369] (make-vtable-vtable extra_fields tail_array_size init) Return a new, self-describing vtable structure. @var{new-fields} is a layout specification describing fields of the resulting structure beginning at the position bound to @code{vtable-offset-user}. @var{tail-size} specifies the size of the tail-array (if any) of this vtable. @var{inits} initializes the fields of the vtable. Minimally, one initializer must be provided: the layout specification for instances of the type this vtable will describe. If a second initializer is provided, it will be interpreted as a print call-back function. @example ;;; loading ,a... (define x (make-vtable-vtable (make-struct-layout (quote pw)) 0 'foo)) (struct? x) @result{} #t (struct-vtable? x) @result{} #t (eq? x (struct-vtable x)) @result{} #t (struct-ref x vtable-offset-user) @result{} foo (struct-ref x 0) @result{} pruosrpwpw (define y (make-struct x 0 (make-struct-layout (quote pwpwpw)) 'bar)) (struct? y) @result{} #t (struct-vtable? y) @result{} #t (eq? x y) @result{} () (eq? x (struct-vtable y)) @result{} #t (struct-ref y 0) @result{} pwpwpw (struct-ref y vtable-offset-user) @result{} bar (define z (make-struct y 0 'a 'b 'c)) (struct? z) @result{} #t (struct-vtable? z) @result{} () (eq? y (struct-vtable z)) @result{} #t (map (lambda (n) (struct-ref z n)) '(0 1 2)) @result{} (a b c) @end example [struct.c:464] (struct-ref handle pos) @deffnx primitive struct-set! struct n value Access (or modify) the @var{n}th field of @var{struct}. If the field is of type 'p', then it can be set to an arbitrary value. If the field is of type 'u', then it can only be set to a non-negative integer value small enough to fit in one machine word. [struct.c:507] (struct-set! handle pos val) [struct.c:586] (struct-vtable handle) Return the vtable structure that describes the type of @var{struct}. [struct.c:660] (struct-vtable-tag handle) [struct.c:671] (struct-vtable-name vtable) [struct.c:710] (set-struct-vtable-name! vtable name) [struct.c:720] (symbol? obj) Returns @t{#t} if @var{obj} is a symbol, otherwise returns @t{#f}. (r5rs) [symbols.c:430] (symbol->string s) Returns the name of @var{symbol} as a string. If the symbol was part of an object returned as the value of a literal expression (section @pxref{Literal expressions}) or by a call to the @samp{read} procedure, and its name contains alphabetic characters, then the string returned will contain characters in the implementation's preferred standard case---some implementations will prefer upper case, others lower case. If the symbol was returned by @samp{string->symbol}, the case of characters in the string returned will be the same as the case in the string that was passed to @samp{string->symbol}. It is an error to apply mutation procedures like @code{string-set!} to strings returned by this procedure. (r5rs) The following examples assume that the implementation's standard case is lower case: @format @t{(symbol->string 'flying-fish) ==> \"flying-fish" (symbol->string 'Martin) ==> \"martin" (symbol->string (string->symbol "Malvina")) ==> \"Malvina" } @end format [symbols.c:461] (string->symbol s) Returns the symbol whose name is @var{string}. This procedure can create symbols with names containing special characters or letters in the non-standard case, but it is usually a bad idea to create such symbols because in some implementations of Scheme they cannot be read as themselves. See @samp{symbol->string}. The following examples assume that the implementation's standard case is lower case: @format @t{(eq? 'mISSISSIppi 'mississippi) ==> #t (string->symbol \"mISSISSIppi\") ==> @r{}the symbol with name \"mISSISSIppi" (eq? 'bitBlt (string->symbol \"bitBlt\")) ==> #f (eq? 'JollyWog (string->symbol (symbol->string 'JollyWog))) ==> #t (string=? \"K. Harper, M.D." (symbol->string (string->symbol \"K. Harper, M.D.\"))) ==> #t } @end format [symbols.c:496] (string->obarray-symbol o s softp) Intern a new symbol in @var{obarray}, a symbol table, with name @var{string}. If @var{obarray} is @code{#f}, use the default system symbol table. If @var{obarray} is @code{#t}, the symbol should not be interned in any symbol table; merely return the pair (@var{symbol} . @var{#}). The @var{soft?} argument determines whether new symbol table entries should be created when the specified symbol is not already present in @var{obarray}. If @var{soft?} is specified and is a true value, then new entries should not be added for symbols not already present in the table; instead, simply return @code{#f}. [symbols.c:522] (intern-symbol o s) Add a new symbol to @var{obarray} with name @var{string}, bound to an unspecified initial value. The symbol table is not modified if a symbol with this name is already present. [symbols.c:554] (unintern-symbol o s) Remove the symbol with name @var{string} from @var{obarray}. This function returns @code{#t} if the symbol was present and @code{#f} otherwise. [symbols.c:591] (symbol-binding o s) Look up in @var{obarray} the symbol whose name is @var{string}, and return the value to which it is bound. If @var{obarray} is @code{#f}, use the global symbol table. If @var{string} is not interned in @var{obarray}, an error is signalled. [symbols.c:632] (symbol-interned? o s) Return @var{#t} if @var{obarray} contains a symbol with name @var{string}, and @var{#f} otherwise. [symbols.c:649] (symbol-bound? o s) Return @var{#t} if @var{obarray} contains a symbol with name @var{string} bound to a defined value. This differs from @var{symbol-bound?} in that the mere mention of a symbol usually causes it to be interned; @code{symbol-bound?} determines whether a symbol has been given any meaningful value. [symbols.c:673] (symbol-set! o s v) Find the symbol in @var{obarray} whose name is @var{string}, and rebind it to @var{value}. An error is signalled if @var{string} is not present in @var{obarray}. [symbols.c:691] (symbol-fref s) Return the contents of @var{symbol}'s @dfn{function slot}. [symbols.c:724] (symbol-pref s) Return the @dfn{property list} currently associated with @var{symbol}. [symbols.c:739] (symbol-fset! s val) Change the binding of @var{symbol}'s function slot. [symbols.c:754] (symbol-pset! s val) Change the binding of @var{symbol}'s property slot. [symbols.c:770] (symbol-hash s) Return the hash value derived from @var{symbol}'s name, i.e. the integer index into @var{symbol}'s obarray at which it is stored. [symbols.c:787] (builtin-bindings) Create and return a copy of the global symbol table, removing all unbound symbols. [symbols.c:826] (builtin-weak-bindings) [symbols.c:839] (gensym name obarray) Create a new, unique symbol in @var{obarray}, using the global symbol table by default. If @var{name} is specified, it should be used as a prefix for the new symbol's name. The default prefix is @code{%%gensym}. [symbols.c:857] (tag x) Return an integer corresponding to the type of X. Deprecated. [tag.c:94] (single-active-thread?) scm_single_thread_p [threads.c:82] (yield) scm_yield [threads.c:88] (call-with-new-thread) scm_call_with_new_thread [threads.c:93] (join-thread) scm_join_thread [threads.c:107] (make-mutex) scm_make_mutex [threads.c:112] (lock-mutex) scm_lock_mutex [threads.c:115] (unlock-mutex) scm_unlock_mutex [threads.c:120] (make-condition-variable) scm_make_condition_variable [threads.c:126] (wait-condition-variable) scm_wait_condition_variable [threads.c:128] (signal-condition-variable) scm_signal_condition_variable [threads.c:130] (catch tag thunk handler) Invoke @var{thunk} in the dynamic context of @var{handler} for exceptions matching @var{key}. If thunk throws to the symbol @var{key}, then @var{handler} is invoked this way: @example (handler key args ...) @end example @var{key} is a symbol or #t. @var{thunk} takes no arguments. If @var{thunk} returns normally, that is the return value of @code{catch}. Handler is invoked outside the scope of its own @code{catch}. If @var{handler} again throws to the same key, a new handler from further up the call chain is invoked. If the key is @code{#t}, then a throw to @emph{any} symbol will match this call to @code{catch}. [throw.c:528] (lazy-catch tag thunk handler) [throw.c:553] (throw key args) Invoke the catch form matching @var{key}, passing @var{args} to the @var{handler}. @var{key} is a symbol. It will match catches of the same symbol or of #t. If there is no handler at all, an error is signaled. [throw.c:586] (uniform-vector-length v) Returns the number of elements in @var{uve}. [unif.c:233] (array? v prot) Returns @code{#t} if the @var{obj} is an array, and @code{#f} if not. The @var{prototype} argument is used with uniform arrays and is described elsewhere. [unif.c:265] (array-rank ra) Returns the number of dimensions of @var{obj}. If @var{obj} is not an array, @code{0} is returned. [unif.c:336] (array-dimensions ra) @code{Array-dimensions} is similar to @code{array-shape} but replaces elements with a @code{0} minimum with one greater than the maximum. So: @example (array-dimensions (make-array 'foo '(-1 3) 5)) @result{} ((-1 3) 5) @end example [unif.c:374] (shared-array-root ra) Return the root vector of a shared array. [unif.c:421] (shared-array-offset ra) Return the root vector index of the first element in the array. [unif.c:432] (shared-array-increments ra) For each dimension, return the distance between elements in the root vector. [unif.c:443] (dimensions->uniform-array dims prot fill) @deffnx primitive make-uniform-vector length prototype [fill] Creates and returns a uniform array or vector of type corresponding to @var{prototype} with dimensions @var{dims} or length @var{length}. If @var{fill} is supplied, it's used to fill the array, otherwise @var{prototype} is used. [unif.c:555] (make-shared-array oldra mapfunc dims) @code{make-shared-array} can be used to create shared subarrays of other arrays. The @var{mapper} is a function that translates coordinates in the new array into coordinates in the old array. A @var{mapper} must be linear, and its range must stay within the bounds of the old array, but it can be otherwise arbitrary. A simple example: @example (define fred (make-array #f 8 8)) (define freds-diagonal (make-shared-array fred (lambda (i) (list i i)) 8)) (array-set! freds-diagonal 'foo 3) (array-ref fred 3 3) @result{} foo (define freds-center (make-shared-array fred (lambda (i j) (list (+ 3 i) (+ 3 j))) 2 2)) (array-ref freds-center 0 0) @result{} foo @end example [unif.c:676] (transpose-array ra args) Returns an array sharing contents with @var{array}, but with dimensions arranged in a different order. There must be one @var{dim} argument for each dimension of @var{array}. @var{dim0}, @var{dim1}, @dots{} should be integers between 0 and the rank of the array to be returned. Each integer in that range must appear at least once in the argument list. The values of @var{dim0}, @var{dim1}, @dots{} correspond to dimensions in the array to be returned, their positions in the argument list to dimensions of @var{array}. Several @var{dim}s may have the same value, in which case the returned array will have smaller rank than @var{array}. examples: @example (transpose-array '#2((a b) (c d)) 1 0) @result{} #2((a c) (b d)) (transpose-array '#2((a b) (c d)) 0 0) @result{} #1(a d) (transpose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1 1 0) @result{} #2((a 4) (b 5) (c 6)) @end example [unif.c:804] (enclose-array ra axes) @var{dim0}, @var{dim1} @dots{} should be nonnegative integers less than the rank of @var{array}. @var{enclose-array} returns an array resembling an array of shared arrays. The dimensions of each shared array are the same as the @var{dim}th dimensions of the original array, the dimensions of the outer array are the same as those of the original array that did not match a @var{dim}. An enclosed array is not a general Scheme array. Its elements may not be set using @code{array-set!}. Two references to the same element of an enclosed array will be @code{equal?} but will not in general be @code{eq?}. The value returned by @var{array-prototype} when given an enclosed array is unspecified. examples: @example (enclose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1) @result{} # (enclose-array '#3(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1 0) @result{} # @end example [unif.c:912] (array-in-bounds? v args) Returns @code{#t} if its arguments would be acceptable to array-ref. [unif.c:992] (array-ref) scm_uniform_vector_ref [unif.c:1067] (uniform-vector-ref v args) Returns the element at the @code{(index1, index2)} element in @var{array}. [unif.c:1072] (uniform-array-set1!) scm_array_set_x [unif.c:1238] (array-set! v obj args) Sets the element at the @code{(index1, index2)} element in @var{array} to @var{new-value}. The value returned by array-set! is unspecified. [unif.c:1246] (array-contents ra strict) @deffnx primitive array-contents array strict If @var{array} may be @dfn{unrolled} into a one dimensional shared array without changing their order (last subscript changing fastest), then @code{array-contents} returns that shared array, otherwise it returns @code{#f}. All arrays made by @var{make-array} and @var{make-uniform-array} may be unrolled, some arrays made by @var{make-shared-array} may not be. If the optional argument @var{strict} is provided, a shared array will be returned only if its elements are stored internally contiguous in memory. [unif.c:1357] (uniform-array-read! ra port_or_fd start end) @deffnx primitive uniform-vector-read! uve [port-or-fdes] [start] [end] Attempts to read all elements of @var{ura}, in lexicographic order, as binary objects from @var{port-or-fdes}. If an end of file is encountered during uniform-array-read! the objects up to that point only are put into @var{ura} (starting at the beginning) and the remainder of the array is unchanged. The optional arguments @var{start} and @var{end} allow a specified region of a vector (or linearized array) to be read, leaving the remainder of the vector unchanged. @code{uniform-array-read!} returns the number of objects read. @var{port-or-fdes} may be omitted, in which case it defaults to the value returned by @code{(current-input-port)}. [unif.c:1465] (uniform-array-write v port_or_fd start end) @deffnx primitive uniform-vector-write uve [port-or-fdes] [start] [end] Writes all elements of @var{ura} as binary objects to @var{port-or-fdes}. The optional arguments @var{start} and @var{end} allow a specified region of a vector (or linearized array) to be written. The number of objects actually written is returned. @var{port-or-fdes} may be omitted, in which case it defaults to the value returned by @code{(current-output-port)}. [unif.c:1614] (bit-count b bitvector) Returns the number of occurrences of the boolean B in BITVECTOR. [unif.c:1724] (bit-position item v k) Returns the minimum index of an occurrence of @var{bool} in @var{bv} which is at least @var{k}. If no @var{bool} occurs within the specified range @code{#f} is returned. [unif.c:1764] (bit-set*! v kv obj) If uve is a bit-vector @var{bv} and uve must be of the same length. If @var{bool} is @code{#t}, uve is OR'ed into @var{bv}; If @var{bool} is @code{#f}, the inversion of uve is AND'ed into @var{bv}. If uve is a unsigned integer vector all the elements of uve must be between 0 and the @code{LENGTH} of @var{bv}. The bits of @var{bv} corresponding to the indexes in uve are set to @var{bool}. The return value is unspecified. [unif.c:1836] (bit-count* v kv obj) Returns @example (bit-count (bit-set*! (if bool bv (bit-invert! bv)) uve #t) #t). @end example @var{bv} is not modified. [unif.c:1894] (bit-invert! v) Modifies @var{bv} by replacing each element with its negation. [unif.c:1964] (array->list v) Returns a list consisting of all the elements, in order, of @var{array}. [unif.c:2047] (list->uniform-array ndim prot lst) @deffnx procedure list->uniform-vector prot lst Returns a uniform array of the type indicated by prototype @var{prot} with elements the same as those of @var{lst}. Elements must be of the appropriate type, no coercions are done. [unif.c:2142] (array-prototype ra) Returns an object that would produce an array of the same type as @var{array}, if used as the @var{prototype} for @code{make-uniform-array}. [unif.c:2492] (make-variable init name_hint) Return a variable object initialized to value INIT. If given, uses NAME-HINT as its internal (debugging) name, otherwise just treat it as an anonymous variable. Remember, of course, that multiple bindings to the same variable may exist, so NAME-HINT is just that---a hint. [variable.c:107] (make-undefined-variable name_hint) Return a variable object initialized to an undefined value. If given, uses NAME-HINT as its internal (debugging) name, otherwise just treat it as an anonymous variable. Remember, of course, that multiple bindings to the same variable may exist, so NAME-HINT is just that---a hint. [variable.c:131] (variable? obj) Return #t iff OBJ is a variable object, else return #f [variable.c:151] (variable-ref var) Dereference VAR and return its value. VAR must be a variable object; see `make-variable' and `make-undefined-variable' [variable.c:163] (variable-set! var val) Set the value of the variable VAR to VAL. VAR must be a variable object, VAL can be any value. Returns an unspecified value. [variable.c:177] (builtin-variable name) Return the built-in variable with the name NAME. NAME must be a symbol (not a string). Then use `variable-ref' to access its value. [variable.c:191] (variable-bound? var) Return #t iff VAR is bound to a value. Throws an error if VAR is not a variable object. [variable.c:219] (vector? obj) Returns @t{#t} if @var{obj} is a vector, otherwise returns @t{#f}. (r5rs) [vectors.c:127] (list->vector) scm_vector [vectors.c:146] (vector l) Returns a newly allocated vector whose elements contain the given arguments. Analogous to @samp{list}. (r5rs) @format @t{(vector 'a 'b 'c) ==> #(a b c) } @end format [vectors.c:164] (make-vector k fill) Returns a newly allocated vector of @var{k} elements. If a second argument is given, then each element is initialized to @var{fill}. Otherwise the initial contents of each element is unspecified. (r5rs) [vectors.c:252] (vector->list v) @samp{Vector->list} returns a newly allocated list of the objects contained in the elements of @var{vector}. (r5rs) @format @t{(vector->list '#(dah dah didah)) => (dah dah didah) list->vector '(dididit dah)) => #(dididit dah) } @end format [vectors.c:287] (vector-fill! v fill_x) Stores @var{fill} in every element of @var{vector}. The value returned by @samp{vector-fill!} is unspecified. (r5rs) [vectors.c:304] (vector-move-left! vec1 start1 end1 vec2 start2) Vector version of @code{substring-move-left!}. [vectors.c:331] (vector-move-right! vec1 start1 end1 vec2 start2) Vector version of @code{substring-move-right!}. [vectors.c:354] (major-version) Return a string containing Guile's major version number. E.g., \"1\". [version.c:57] (minor-version) Return a string containing Guile's minor version number. E.g., \"3.5\". [version.c:69] (version) @deffnx primitive major-version @deffnx primitive minor-version Return a string describing Guile's version number, or its major or minor version numbers, respectively. @example (version) @result{} \"1.3a" (major-version) @result{} \"1" (minor-version) @result{} \"3a" @end example [version.c:88] (make-soft-port pv modes) Returns a port capable of receiving or delivering characters as specified by the @var{modes} string (@pxref{File Ports, open-file}). @var{vector} must be a vector of length 6. Its components are as follows: @enumerate 0 @item procedure accepting one character for output @item procedure accepting a string for output @item thunk for flushing output @item thunk for getting one character @item thunk for closing port (not by garbage collection) @end enumerate For an output-only port only elements 0, 1, 2, and 4 need be procedures. For an input-only port only elements 3 and 4 need be procedures. Thunks 2 and 4 can instead be @code{#f} if there is no useful operation for them to perform. If thunk 3 returns @code{#f} or an @code{eof-object} (@pxref{Input, eof-object?, ,r4rs, The Revised^4 Report on Scheme}) it indicates that the port has reached end-of-file. For example: @example (define stdout (current-output-port)) (define p (make-soft-port (vector (lambda (c) (write c stdout)) (lambda (s) (display s stdout)) (lambda () (display \".\" stdout)) (lambda () (char-upcase (read-char))) (lambda () (display \"@@\" stdout))) \"rw\")) (write p p) @result{} # @end example [vports.c:177] (make-weak-vector k fill) Return a weak vector with @var{size} elements. If the optional argument @var{fill} is given, all entries in the vector will be set to @var{fill}. The default value for @var{fill} is the empty list. [weaks.c:61] (list->weak-vector) scm_weak_vector [weaks.c:77] (weak-vector l) @deffnx primitive list->weak-vector l Construct a weak vector from a list: @code{weak-vector} uses the list of its arguments while @code{list->weak-vector} uses its only argument @var{l} (a list) to construct a weak vector the same way @code{vector->list} would. [weaks.c:85] (weak-vector? x) Return @var{#t} if @var{obj} is a weak vector. Note that all weak hashes are also weak vectors. [weaks.c:108] (make-weak-key-hash-table k) @deffnx primitive make-weak-value-hash-table size @deffnx primitive make-doubly-weak-hash-table size Return a weak hash table with @var{size} buckets. As with any hash table, choosing a good size for the table requires some caution. You can modify weak hash tables in exactly the same way you would modify regular hash tables. (@pxref{Hash Tables}) [weaks.c:128] (make-weak-value-hash-table k) [weaks.c:144] (make-doubly-weak-hash-table k) [weaks.c:161] (weak-key-hash-table? x) @deffnx primitive weak-value-hash-table? obj @deffnx primitive doubly-weak-hash-table? obj Return @var{#t} if @var{obj} is the specified weak hash table. Note that a doubly weak hash table is neither a weak key nor a weak value hash table. [weaks.c:180] (weak-value-hash-table? x) [weaks.c:190] (doubly-weak-hash-table? x) [weaks.c:200]