X-Git-Url: http://git.hcoop.net/bpt/guile.git/blobdiff_plain/3d1f24d1f8a80f6b20a43a7beccba95620b62152..eb7da3d81f565ae20b0a35dda0607537e969ff59:/doc/maint/guile.texi diff --git a/doc/maint/guile.texi b/doc/maint/guile.texi index 953b4f910..c0570f24b 100644 --- a/doc/maint/guile.texi +++ b/doc/maint/guile.texi @@ -1,6 +1,6 @@ acons -@c snarfed from alist.c:35 +@c snarfed from alist.c:36 @deffn {Scheme Procedure} acons key value alist @deffnx {C Function} scm_acons (key, value, alist) Add a new key-value pair to @var{alist}. A new pair is @@ -10,7 +10,7 @@ function is @emph{not} destructive; @var{alist} is not modified. @end deffn sloppy-assq -@c snarfed from alist.c:49 +@c snarfed from alist.c:50 @deffn {Scheme Procedure} sloppy-assq key alist @deffnx {C Function} scm_sloppy_assq (key, alist) Behaves like @code{assq} but does not do any error checking. @@ -18,7 +18,7 @@ Recommended only for use in Guile internals. @end deffn sloppy-assv -@c snarfed from alist.c:67 +@c snarfed from alist.c:68 @deffn {Scheme Procedure} sloppy-assv key alist @deffnx {C Function} scm_sloppy_assv (key, alist) Behaves like @code{assv} but does not do any error checking. @@ -26,7 +26,7 @@ Recommended only for use in Guile internals. @end deffn sloppy-assoc -@c snarfed from alist.c:85 +@c snarfed from alist.c:86 @deffn {Scheme Procedure} sloppy-assoc key alist @deffnx {C Function} scm_sloppy_assoc (key, alist) Behaves like @code{assoc} but does not do any error checking. @@ -34,7 +34,7 @@ Recommended only for use in Guile internals. @end deffn assq -@c snarfed from alist.c:112 +@c snarfed from alist.c:113 @deffn {Scheme Procedure} assq key alist @deffnx {Scheme Procedure} assv key alist @deffnx {Scheme Procedure} assoc key alist @@ -49,21 +49,21 @@ return the entire alist entry found (i.e. both the key and the value). @end deffn assv -@c snarfed from alist.c:133 +@c snarfed from alist.c:134 @deffn {Scheme Procedure} assv key alist @deffnx {C Function} scm_assv (key, alist) Behaves like @code{assq} but uses @code{eqv?} for key comparison. @end deffn assoc -@c snarfed from alist.c:154 +@c snarfed from alist.c:155 @deffn {Scheme Procedure} assoc key alist @deffnx {C Function} scm_assoc (key, alist) Behaves like @code{assq} but uses @code{equal?} for key comparison. @end deffn assq-ref -@c snarfed from alist.c:198 +@c snarfed from alist.c:199 @deffn {Scheme Procedure} assq-ref alist key @deffnx {Scheme Procedure} assv-ref alist key @deffnx {Scheme Procedure} assoc-ref alist key @@ -81,21 +81,21 @@ where @var{associator} is one of @code{assq}, @code{assv} or @code{assoc}. @end deffn assv-ref -@c snarfed from alist.c:215 +@c snarfed from alist.c:216 @deffn {Scheme Procedure} assv-ref alist key @deffnx {C Function} scm_assv_ref (alist, key) Behaves like @code{assq-ref} but uses @code{eqv?} for key comparison. @end deffn assoc-ref -@c snarfed from alist.c:232 +@c snarfed from alist.c:233 @deffn {Scheme Procedure} assoc-ref alist key @deffnx {C Function} scm_assoc_ref (alist, key) Behaves like @code{assq-ref} but uses @code{equal?} for key comparison. @end deffn assq-set! -@c snarfed from alist.c:261 +@c snarfed from alist.c:262 @deffn {Scheme Procedure} assq-set! alist key val @deffnx {Scheme Procedure} assv-set! alist key value @deffnx {Scheme Procedure} assoc-set! alist key value @@ -111,21 +111,21 @@ association list. @end deffn assv-set! -@c snarfed from alist.c:279 +@c snarfed from alist.c:280 @deffn {Scheme Procedure} assv-set! alist key val @deffnx {C Function} scm_assv_set_x (alist, key, val) Behaves like @code{assq-set!} but uses @code{eqv?} for key comparison. @end deffn assoc-set! -@c snarfed from alist.c:297 +@c snarfed from alist.c:298 @deffn {Scheme Procedure} assoc-set! alist key val @deffnx {C Function} scm_assoc_set_x (alist, key, val) Behaves like @code{assq-set!} but uses @code{equal?} for key comparison. @end deffn assq-remove! -@c snarfed from alist.c:321 +@c snarfed from alist.c:322 @deffn {Scheme Procedure} assq-remove! alist key @deffnx {Scheme Procedure} assv-remove! alist key @deffnx {Scheme Procedure} assoc-remove! alist key @@ -135,14 +135,14 @@ the resulting alist. @end deffn assv-remove! -@c snarfed from alist.c:337 +@c snarfed from alist.c:338 @deffn {Scheme Procedure} assv-remove! alist key @deffnx {C Function} scm_assv_remove_x (alist, key) Behaves like @code{assq-remove!} but uses @code{eqv?} for key comparison. @end deffn assoc-remove! -@c snarfed from alist.c:353 +@c snarfed from alist.c:354 @deffn {Scheme Procedure} assoc-remove! alist key @deffnx {C Function} scm_assoc_remove_x (alist, key) Behaves like @code{assq-remove!} but uses @code{equal?} for key comparison. @@ -199,8 +199,17 @@ Mark the async @var{a} for future execution. Execute all thunks from the asyncs of the list @var{list_of_a}. @end deffn + system-async +@c snarfed from async.c:180 +@deffn {Scheme Procedure} system-async thunk +@deffnx {C Function} scm_system_async (thunk) +This function is deprecated. You can use @var{thunk} directly +instead of explicitly creating an async object. + +@end deffn + system-async-mark -@c snarfed from async.c:222 +@c snarfed from async.c:296 @deffn {Scheme Procedure} system-async-mark proc [thread] @deffnx {C Function} scm_system_async_mark_for_thread (proc, thread) Mark @var{proc} (a procedure with zero arguments) for future execution @@ -215,15 +224,29 @@ signal handlers. @end deffn noop -@c snarfed from async.c:253 +@c snarfed from async.c:335 @deffn {Scheme Procedure} noop . args @deffnx {C Function} scm_noop (args) Do nothing. When called without arguments, return @code{#f}, otherwise return the first argument. @end deffn + unmask-signals +@c snarfed from async.c:350 +@deffn {Scheme Procedure} unmask-signals +@deffnx {C Function} scm_unmask_signals () +Unmask signals. The returned value is not specified. +@end deffn + + mask-signals +@c snarfed from async.c:370 +@deffn {Scheme Procedure} mask-signals +@deffnx {C Function} scm_mask_signals () +Mask signals. The returned value is not specified. +@end deffn + call-with-blocked-asyncs -@c snarfed from async.c:319 +@c snarfed from async.c:404 @deffn {Scheme Procedure} call-with-blocked-asyncs proc @deffnx {C Function} scm_call_with_blocked_asyncs (proc) Call @var{proc} with no arguments and block the execution @@ -233,7 +256,7 @@ it is running. Return the value returned by @var{proc}. @end deffn call-with-unblocked-asyncs -@c snarfed from async.c:343 +@c snarfed from async.c:430 @deffn {Scheme Procedure} call-with-unblocked-asyncs proc @deffnx {C Function} scm_call_with_unblocked_asyncs (proc) Call @var{proc} with no arguments and unblock the execution @@ -256,7 +279,7 @@ ignored. @end deffn display-application -@c snarfed from backtrace.c:446 +@c snarfed from backtrace.c:425 @deffn {Scheme Procedure} display-application frame [port [indent]] @deffnx {C Function} scm_display_application (frame, port, indent) Display a procedure application @var{frame} to the output port @@ -265,22 +288,27 @@ output. @end deffn display-backtrace -@c snarfed from backtrace.c:756 -@deffn {Scheme Procedure} display-backtrace stack port [first [depth]] -@deffnx {C Function} scm_display_backtrace (stack, port, first, depth) +@c snarfed from backtrace.c:740 +@deffn {Scheme Procedure} display-backtrace stack port [first [depth [highlights]]] +@deffnx {C Function} scm_display_backtrace_with_highlights (stack, port, first, depth, highlights) Display a backtrace to the output port @var{port}. @var{stack} is the stack to take the backtrace from, @var{first} specifies where in the stack to start and @var{depth} how much frames to display. Both @var{first} and @var{depth} can be @code{#f}, which means that default values will be used. +When @var{highlights} is given, +it should be a list and all members of it are highligthed in +the backtrace. @end deffn backtrace -@c snarfed from backtrace.c:779 -@deffn {Scheme Procedure} backtrace -@deffnx {C Function} scm_backtrace () +@c snarfed from backtrace.c:776 +@deffn {Scheme Procedure} backtrace [highlights] +@deffnx {C Function} scm_backtrace_with_highlights (highlights) Display a backtrace of the stack saved by the last error -to the current output port. +to the current output port. When @var{highlights} is given, +it should be a list and all members of it are highligthed in +the backtrace. @end deffn not @@ -450,8 +478,25 @@ Return the uppercase character version of @var{chr}. Return the lowercase character version of @var{chr}. @end deffn + with-continuation-barrier +@c snarfed from continuations.c:412 +@deffn {Scheme Procedure} with-continuation-barrier proc +@deffnx {C Function} scm_with_continuation_barrier (proc) +Call @var{proc} and return its result. Do not allow the invocation of +continuations that would leave or enter the dynamic extent of the call +to @code{with-continuation-barrier}. Such an attempt causes an error +to be signaled. + +Throws (such as errors) that are not caught from within @var{proc} are +caught by @code{with-continuation-barrier}. In that case, a short +message is printed to the current error port and @code{#f} is returned. + +Thus, @code{with-continuation-barrier} returns exactly once. + +@end deffn + debug-options-interface -@c snarfed from debug.c:53 +@c snarfed from debug.c:54 @deffn {Scheme Procedure} debug-options-interface [setting] @deffnx {C Function} scm_debug_options (setting) Option interface for the debug options. Instead of using @@ -460,14 +505,14 @@ this procedure directly, use the procedures @code{debug-enable}, @end deffn with-traps -@c snarfed from debug.c:96 +@c snarfed from debug.c:101 @deffn {Scheme Procedure} with-traps thunk @deffnx {C Function} scm_with_traps (thunk) Call @var{thunk} with traps enabled. @end deffn memoized? -@c snarfed from debug.c:134 +@c snarfed from debug.c:139 @deffn {Scheme Procedure} memoized? obj @deffnx {C Function} scm_memoized_p (obj) Return @code{#t} if @var{obj} is memoized. @@ -525,6 +570,13 @@ is implicit). Return @code{#t} if @var{obj} is a debug object. @end deffn + issue-deprecation-warning +@c snarfed from deprecation.c:99 +@deffn {Scheme Procedure} issue-deprecation-warning . msgs +@deffnx {C Function} scm_issue_deprecation_warning (msgs) +Output @var{msgs} to @code{(current-error-port)} when this is the first call to @code{issue-deprecation-warning} with this specific @var{msgs}. Do nothing otherwise. The argument @var{msgs} should be a list of strings; they are printed in turn, each one followed by a newline. +@end deffn + include-deprecated-features @c snarfed from deprecation.c:144 @deffn {Scheme Procedure} include-deprecated-features @@ -532,6 +584,199 @@ Return @code{#t} if @var{obj} is a debug object. Return @code{#t} iff deprecated features should be included in public interfaces. @end deffn + substring-move-left! +@c snarfed from deprecated.c:73 +@deffn {Scheme Procedure} substring-move-left! +implemented by the C function "scm_substring_move_x" +@end deffn + + substring-move-right! +@c snarfed from deprecated.c:75 +@deffn {Scheme Procedure} substring-move-right! +implemented by the C function "scm_substring_move_x" +@end deffn + + c-registered-modules +@c snarfed from deprecated.c:178 +@deffn {Scheme Procedure} c-registered-modules +@deffnx {C Function} scm_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. +@end deffn + + c-clear-registered-modules +@c snarfed from deprecated.c:199 +@deffn {Scheme Procedure} c-clear-registered-modules +@deffnx {C Function} scm_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. +@end deffn + + close-all-ports-except +@c snarfed from deprecated.c:342 +@deffn {Scheme Procedure} close-all-ports-except . ports +@deffnx {C Function} scm_close_all_ports_except (ports) +[DEPRECATED] Close all open file ports used by the interpreter +except for those supplied as arguments. This procedure +was intended to be used before an exec call to close file descriptors +which are not needed in the new process. However it has the +undesirable side effect of flushing buffers, so it's deprecated. +Use port-for-each instead. +@end deffn + + variable-set-name-hint! +@c snarfed from deprecated.c:359 +@deffn {Scheme Procedure} variable-set-name-hint! var hint +@deffnx {C Function} scm_variable_set_name_hint (var, hint) +Do not use this function. +@end deffn + + builtin-variable +@c snarfed from deprecated.c:372 +@deffn {Scheme Procedure} builtin-variable name +@deffnx {C Function} scm_builtin_variable (name) +Do not use this function. +@end deffn + + sloppy-memq +@c snarfed from deprecated.c:446 +@deffn {Scheme Procedure} sloppy-memq x lst +@deffnx {C Function} scm_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. +@end deffn + + sloppy-memv +@c snarfed from deprecated.c:466 +@deffn {Scheme Procedure} sloppy-memv x lst +@deffnx {C Function} scm_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. +@end deffn + + sloppy-member +@c snarfed from deprecated.c:486 +@deffn {Scheme Procedure} sloppy-member x lst +@deffnx {C Function} scm_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. +@end deffn + + read-and-eval! +@c snarfed from deprecated.c:508 +@deffn {Scheme Procedure} read-and-eval! [port] +@deffnx {C Function} scm_read_and_eval_x (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. +@end deffn + + string->obarray-symbol +@c snarfed from deprecated.c:825 +@deffn {Scheme Procedure} string->obarray-symbol o s [softp] +@deffnx {C Function} scm_string_to_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}. +@end deffn + + intern-symbol +@c snarfed from deprecated.c:863 +@deffn {Scheme Procedure} intern-symbol o s +@deffnx {C Function} scm_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. +@end deffn + + unintern-symbol +@c snarfed from deprecated.c:905 +@deffn {Scheme Procedure} unintern-symbol o s +@deffnx {C Function} scm_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. +@end deffn + + symbol-binding +@c snarfed from deprecated.c:950 +@deffn {Scheme Procedure} symbol-binding o s +@deffnx {C Function} scm_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. +@end deffn + + symbol-bound? +@c snarfed from deprecated.c:1003 +@deffn {Scheme Procedure} symbol-bound? o s +@deffnx {C Function} scm_symbol_bound_p (o, s) +Return @code{#t} if @var{obarray} contains a symbol with name +@var{string} bound to a defined value. This differs from +@var{symbol-interned?} 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. +@end deffn + + symbol-set! +@c snarfed from deprecated.c:1030 +@deffn {Scheme Procedure} symbol-set! o s v +@deffnx {C Function} scm_symbol_set_x (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}. +@end deffn + + gentemp +@c snarfed from deprecated.c:1063 +@deffn {Scheme Procedure} gentemp [prefix [obarray]] +@deffnx {C Function} scm_gentemp (prefix, obarray) +Create a new symbol with a name unique in an obarray. +The name is constructed from an optional string @var{prefix} +and a counter value. The default prefix is @code{t}. The +@var{obarray} is specified as a second optional argument. +Default is the system obarray where all normal symbols are +interned. The counter is increased by 1 at each +call. There is no provision for resetting the counter. +@end deffn + + make-keyword-from-dash-symbol +@c snarfed from discouraged.c:161 +@deffn {Scheme Procedure} make-keyword-from-dash-symbol symbol +@deffnx {C Function} scm_make_keyword_from_dash_symbol (symbol) +Make a keyword object from a @var{symbol} that starts with a dash. +@end deffn + + keyword-dash-symbol +@c snarfed from discouraged.c:183 +@deffn {Scheme Procedure} keyword-dash-symbol keyword +@deffnx {C Function} scm_keyword_dash_symbol (keyword) +Return the dash symbol for @var{keyword}. +This is the inverse of @code{make-keyword-from-dash-symbol}. +@end deffn + dynamic-link @c snarfed from dynl.c:149 @deffn {Scheme Procedure} dynamic-link filename @@ -834,7 +1079,7 @@ bindings change. @end deffn make-leaf-environment -@c snarfed from environments.c:1015 +@c snarfed from environments.c:1017 @deffn {Scheme Procedure} make-leaf-environment @deffnx {C Function} scm_make_leaf_environment () Create a new leaf environment, containing no bindings. @@ -843,7 +1088,7 @@ will be mutable. @end deffn leaf-environment? -@c snarfed from environments.c:1038 +@c snarfed from environments.c:1040 @deffn {Scheme Procedure} leaf-environment? object @deffnx {C Function} scm_leaf_environment_p (object) Return @code{#t} if object is a leaf environment, or @code{#f} @@ -851,7 +1096,7 @@ otherwise. @end deffn make-eval-environment -@c snarfed from environments.c:1403 +@c snarfed from environments.c:1405 @deffn {Scheme Procedure} make-eval-environment local imported @deffnx {C Function} scm_make_eval_environment (local, imported) Return a new environment object eval whose bindings are the @@ -878,7 +1123,7 @@ In typical use, @var{local} will be a finite environment, and @end deffn eval-environment? -@c snarfed from environments.c:1440 +@c snarfed from environments.c:1442 @deffn {Scheme Procedure} eval-environment? object @deffnx {C Function} scm_eval_environment_p (object) Return @code{#t} if object is an eval environment, or @code{#f} @@ -886,35 +1131,35 @@ otherwise. @end deffn eval-environment-local -@c snarfed from environments.c:1450 +@c snarfed from environments.c:1452 @deffn {Scheme Procedure} eval-environment-local env @deffnx {C Function} scm_eval_environment_local (env) Return the local environment of eval environment @var{env}. @end deffn eval-environment-set-local! -@c snarfed from environments.c:1462 +@c snarfed from environments.c:1464 @deffn {Scheme Procedure} eval-environment-set-local! env local @deffnx {C Function} scm_eval_environment_set_local_x (env, local) Change @var{env}'s local environment to @var{local}. @end deffn eval-environment-imported -@c snarfed from environments.c:1488 +@c snarfed from environments.c:1490 @deffn {Scheme Procedure} eval-environment-imported env @deffnx {C Function} scm_eval_environment_imported (env) Return the imported environment of eval environment @var{env}. @end deffn eval-environment-set-imported! -@c snarfed from environments.c:1500 +@c snarfed from environments.c:1502 @deffn {Scheme Procedure} eval-environment-set-imported! env imported @deffnx {C Function} scm_eval_environment_set_imported_x (env, imported) Change @var{env}'s imported environment to @var{imported}. @end deffn make-import-environment -@c snarfed from environments.c:1823 +@c snarfed from environments.c:1825 @deffn {Scheme Procedure} make-import-environment imports conflict_proc @deffnx {C Function} scm_make_import_environment (imports, conflict_proc) Return a new environment @var{imp} whose bindings are the union @@ -945,7 +1190,7 @@ if one of its imported environments changes. @end deffn import-environment? -@c snarfed from environments.c:1852 +@c snarfed from environments.c:1854 @deffn {Scheme Procedure} import-environment? object @deffnx {C Function} scm_import_environment_p (object) Return @code{#t} if object is an import environment, or @@ -953,7 +1198,7 @@ Return @code{#t} if object is an import environment, or @end deffn import-environment-imports -@c snarfed from environments.c:1863 +@c snarfed from environments.c:1865 @deffn {Scheme Procedure} import-environment-imports env @deffnx {C Function} scm_import_environment_imports (env) Return the list of environments imported by the import @@ -961,7 +1206,7 @@ environment @var{env}. @end deffn import-environment-set-imports! -@c snarfed from environments.c:1876 +@c snarfed from environments.c:1878 @deffn {Scheme Procedure} import-environment-set-imports! env imports @deffnx {C Function} scm_import_environment_set_imports_x (env, imports) Change @var{env}'s list of imported environments to @@ -969,7 +1214,7 @@ Change @var{env}'s list of imported environments to @end deffn make-export-environment -@c snarfed from environments.c:2143 +@c snarfed from environments.c:2145 @deffn {Scheme Procedure} make-export-environment private signature @deffnx {C Function} scm_make_export_environment (private, signature) Return a new environment @var{exp} containing only those @@ -1019,7 +1264,7 @@ if the bindings in private change. @end deffn export-environment? -@c snarfed from environments.c:2178 +@c snarfed from environments.c:2180 @deffn {Scheme Procedure} export-environment? object @deffnx {C Function} scm_export_environment_p (object) Return @code{#t} if object is an export environment, or @@ -1027,65 +1272,139 @@ Return @code{#t} if object is an export environment, or @end deffn export-environment-private -@c snarfed from environments.c:2188 +@c snarfed from environments.c:2190 @deffn {Scheme Procedure} export-environment-private env @deffnx {C Function} scm_export_environment_private (env) Return the private environment of export environment @var{env}. @end deffn export-environment-set-private! -@c snarfed from environments.c:2200 +@c snarfed from environments.c:2202 @deffn {Scheme Procedure} export-environment-set-private! env private @deffnx {C Function} scm_export_environment_set_private_x (env, private) Change the private environment of export environment @var{env}. @end deffn export-environment-signature -@c snarfed from environments.c:2222 +@c snarfed from environments.c:2224 @deffn {Scheme Procedure} export-environment-signature env @deffnx {C Function} scm_export_environment_signature (env) Return the signature of export environment @var{env}. @end deffn export-environment-set-signature! -@c snarfed from environments.c:2296 +@c snarfed from environments.c:2298 @deffn {Scheme Procedure} export-environment-set-signature! env signature @deffnx {C Function} scm_export_environment_set_signature_x (env, signature) Change the signature of export environment @var{env}. @end deffn eq? -@c snarfed from eq.c:47 +@c snarfed from eq.c:81 @deffn {Scheme Procedure} eq? x y -Return @code{#t} iff @var{x} references the same object as @var{y}. -@code{eq?} is similar to @code{eqv?} except that in some cases it is -capable of discerning distinctions finer than those detectable by -@code{eqv?}. +Return @code{#t} if @var{x} and @var{y} are the same object, +except for numbers and characters. For example, + +@example +(define x (vector 1 2 3)) +(define y (vector 1 2 3)) + +(eq? x x) @result{} #t +(eq? x y) @result{} #f +@end example + +Numbers and characters are not equal to any other object, but +the problem is they're not necessarily @code{eq?} to themselves +either. This is even so when the number comes directly from a +variable, + +@example +(let ((n (+ 2 3))) + (eq? n n)) @result{} *unspecified* +@end example + +Generally @code{eqv?} should be used when comparing numbers or +characters. @code{=} or @code{char=?} can be used too. + +It's worth noting that end-of-list @code{()}, @code{#t}, +@code{#f}, a symbol of a given name, and a keyword of a given +name, are unique objects. There's just one of each, so for +instance no matter how @code{()} arises in a program, it's the +same object and can be compared with @code{eq?}, + +@example +(define x (cdr '(123))) +(define y (cdr '(456))) +(eq? x y) @result{} #t + +(define x (string->symbol "foo")) +(eq? x 'foo) @result{} #t +@end example @end deffn eqv? -@c snarfed from eq.c:71 +@c snarfed from eq.c:116 @deffn {Scheme Procedure} eqv? x y -The @code{eqv?} procedure defines a useful equivalence relation on objects. -Briefly, it returns @code{#t} if @var{x} and @var{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. +Return @code{#t} if @var{x} and @var{y} are the same object, or +for characters and numbers the same value. + +On objects except characters and numbers, @code{eqv?} is the +same as @code{eq?}, it's true if @var{x} and @var{y} are the +same object. + +If @var{x} and @var{y} are numbers or characters, @code{eqv?} +compares their type and value. An exact number is not +@code{eqv?} to an inexact number (even if their value is the +same). + +@example +(eqv? 3 (+ 1 2)) @result{} #t +(eqv? 1 1.0) @result{} #f +@end example @end deffn equal? -@c snarfed from eq.c:138 +@c snarfed from eq.c:212 @deffn {Scheme Procedure} equal? x y -Return @code{#t} iff @var{x} and @var{y} are recursively @code{eqv?} equivalent. -@code{equal?} recursively compares the contents of pairs, -vectors, and strings, applying @code{eqv?} on other objects such as -numbers and symbols. A rule of thumb is that objects are generally -@code{equal?} if they print the same. @code{equal?} may fail to -terminate if its arguments are circular data structures. +Return @code{#t} if @var{x} and @var{y} are the same type, and +their contents or value are equal. + +For a pair, string, vector or array, @code{equal?} compares the +contents, and does so using using the same @code{equal?} +recursively, so a deep structure can be traversed. + +@example +(equal? (list 1 2 3) (list 1 2 3)) @result{} #t +(equal? (list 1 2 3) (vector 1 2 3)) @result{} #f +@end example + +For other objects, @code{equal?} compares as per @code{eqv?}, +which means characters and numbers are compared by type and +value (and like @code{eqv?}, exact and inexact numbers are not +@code{equal?}, even if their value is the same). + +@example +(equal? 3 (+ 1 2)) @result{} #t +(equal? 1 1.0) @result{} #f +@end example + +Hash tables are currently only compared as per @code{eq?}, so +two different tables are not @code{equal?}, even if their +contents are the same. + +@code{equal?} does not support circular data structures, it may +go into an infinite loop if asked to compare two circular lists +or similar. + +New application-defined object types (Smobs) have an +@code{equalp} handler which is called by @code{equal?}. This +lets an application traverse the contents or control what is +considered @code{equal?} for two such objects. If there's no +handler, the default is to just compare as per @code{eq?}. @end deffn scm-error -@c snarfed from error.c:81 +@c snarfed from error.c:82 @deffn {Scheme Procedure} scm-error key subr message args data @deffnx {C Function} scm_error_scm (key, subr, message, args, data) Raise an error with key @var{key}. @var{subr} can be a string @@ -1099,12 +1418,14 @@ Guile) formats using @code{display} and @code{~S} (was @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 +should be a list containing the Unix signal number; If +@var{key} is @code{out-of-range} or @code{wrong-type-arg}, +it is a list containing the bad value; otherwise it will usually be @code{#f}. @end deffn strerror -@c snarfed from error.c:128 +@c snarfed from error.c:129 @deffn {Scheme Procedure} strerror err @deffnx {C Function} scm_strerror (err) Return the Unix error message corresponding to @var{err}, which @@ -1112,7 +1433,7 @@ must be an integer value. @end deffn apply:nconc2last -@c snarfed from eval.c:4700 +@c snarfed from eval.c:4686 @deffn {Scheme Procedure} apply:nconc2last lst @deffnx {C Function} scm_nconc2last (lst) Given a list (@var{arg1} @dots{} @var{args}), this function @@ -1125,7 +1446,7 @@ destroys its argument, so use with care. @end deffn force -@c snarfed from eval.c:5628 +@c snarfed from eval.c:5598 @deffn {Scheme Procedure} force promise @deffnx {C Function} scm_force (promise) If the promise @var{x} has not been computed yet, compute and @@ -1134,7 +1455,7 @@ value. @end deffn promise? -@c snarfed from eval.c:5651 +@c snarfed from eval.c:5621 @deffn {Scheme Procedure} promise? obj @deffnx {C Function} scm_promise_p (obj) Return true if @var{obj} is a promise, i.e. a delayed computation @@ -1142,7 +1463,7 @@ Return true if @var{obj} is a promise, i.e. a delayed computation @end deffn cons-source -@c snarfed from eval.c:5663 +@c snarfed from eval.c:5633 @deffn {Scheme Procedure} cons-source xorig x y @deffnx {C Function} scm_cons_source (xorig, x, y) Create and return a new pair whose car and cdr are @var{x} and @var{y}. @@ -1151,7 +1472,7 @@ with the new pair. @end deffn copy-tree -@c snarfed from eval.c:5820 +@c snarfed from eval.c:5790 @deffn {Scheme Procedure} copy-tree obj @deffnx {C Function} scm_copy_tree (obj) Recursively copy the data tree that is bound to @var{obj}, and return a @@ -1162,7 +1483,7 @@ any other object. @end deffn primitive-eval -@c snarfed from eval.c:5906 +@c snarfed from eval.c:5878 @deffn {Scheme Procedure} primitive-eval exp @deffnx {C Function} scm_primitive_eval (exp) Evaluate @var{exp} in the top-level environment specified by @@ -1170,18 +1491,20 @@ the current module. @end deffn eval -@c snarfed from eval.c:5975 -@deffn {Scheme Procedure} eval exp module -@deffnx {C Function} scm_eval (exp, module) +@c snarfed from eval.c:5922 +@deffn {Scheme Procedure} eval exp module_or_state +@deffnx {C Function} scm_eval (exp, module_or_state) Evaluate @var{exp}, a list representing a Scheme expression, -in the top-level environment specified by @var{module}. +in the top-level environment specified by +@var{module_or_state}. While @var{exp} is evaluated (using @code{primitive-eval}), -@var{module} is made the current module. The current module -is reset to its previous value when @var{eval} returns. +@var{module_or_state} is made the current module when +it is a module, or the current dynamic state when it is +a dynamic state.Example: (eval '(+ 1 2) (interaction-environment)) @end deffn eval-options-interface -@c snarfed from eval.c:3090 +@c snarfed from eval.c:3086 @deffn {Scheme Procedure} eval-options-interface [setting] @deffnx {C Function} scm_eval_options_interface (setting) Option interface for the evaluation options. Instead of using @@ -1190,7 +1513,7 @@ this procedure directly, use the procedures @code{eval-enable}, @end deffn evaluator-traps-interface -@c snarfed from eval.c:3108 +@c snarfed from eval.c:3104 @deffn {Scheme Procedure} evaluator-traps-interface [setting] @deffnx {C Function} scm_evaluator_traps (setting) Option interface for the evaluator trap options. @@ -1257,7 +1580,7 @@ well. For example, @end deffn program-arguments -@c snarfed from feature.c:56 +@c snarfed from feature.c:57 @deffn {Scheme Procedure} program-arguments @deffnx {Scheme Procedure} command-line @deffnx {C Function} scm_program_arguments () @@ -1268,20 +1591,20 @@ options like @code{-e} and @code{-l}. @end deffn make-fluid -@c snarfed from fluids.c:100 +@c snarfed from fluids.c:260 @deffn {Scheme Procedure} make-fluid @deffnx {C Function} scm_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 are objects that can hold one +value per dynamic state. That is, modifications to this value are +only visible to code that executes with the same dynamic state as +the modifying code. When a new dynamic state is constructed, it +inherits the values from its parent. Because each thread normally executes +with its own dynamic state, you can use fluids for thread local storage. @end deffn fluid? -@c snarfed from fluids.c:113 +@c snarfed from fluids.c:283 @deffn {Scheme Procedure} fluid? obj @deffnx {C Function} scm_fluid_p (obj) Return @code{#t} iff @var{obj} is a fluid; otherwise, return @@ -1289,7 +1612,7 @@ Return @code{#t} iff @var{obj} is a fluid; otherwise, return @end deffn fluid-ref -@c snarfed from fluids.c:124 +@c snarfed from fluids.c:306 @deffn {Scheme Procedure} fluid-ref fluid @deffnx {C Function} scm_fluid_ref (fluid) Return the value associated with @var{fluid} in the current @@ -1298,14 +1621,14 @@ dynamic root. If @var{fluid} has not been set, then return @end deffn fluid-set! -@c snarfed from fluids.c:140 +@c snarfed from fluids.c:325 @deffn {Scheme Procedure} fluid-set! fluid value @deffnx {C Function} scm_fluid_set_x (fluid, value) Set the value associated with @var{fluid} in the current dynamic root. @end deffn with-fluids* -@c snarfed from fluids.c:206 +@c snarfed from fluids.c:395 @deffn {Scheme Procedure} with-fluids* fluids values thunk @deffnx {C Function} scm_with_fluids (fluids, values, thunk) Set @var{fluids} to @var{values} temporary, and call @var{thunk}. @@ -1315,13 +1638,52 @@ one after another. @var{thunk} must be a procedure with no argument. @end deffn with-fluid* -@c snarfed from fluids.c:245 +@c snarfed from fluids.c:434 @deffn {Scheme Procedure} with-fluid* fluid value thunk @deffnx {C Function} scm_with_fluid (fluid, value, thunk) Set @var{fluid} to @var{value} temporarily, and call @var{thunk}. @var{thunk} must be a procedure with no argument. @end deffn + make-dynamic-state +@c snarfed from fluids.c:487 +@deffn {Scheme Procedure} make-dynamic-state [parent] +@deffnx {C Function} scm_make_dynamic_state (parent) +Return a copy of the dynamic state object @var{parent} +or of the current dynamic state when @var{parent} is omitted. +@end deffn + + dynamic-state? +@c snarfed from fluids.c:515 +@deffn {Scheme Procedure} dynamic-state? obj +@deffnx {C Function} scm_dynamic_state_p (obj) +Return @code{#t} if @var{obj} is a dynamic state object; +return @code{#f} otherwise +@end deffn + + current-dynamic-state +@c snarfed from fluids.c:530 +@deffn {Scheme Procedure} current-dynamic-state +@deffnx {C Function} scm_current_dynamic_state () +Return the current dynamic state object. +@end deffn + + set-current-dynamic-state +@c snarfed from fluids.c:540 +@deffn {Scheme Procedure} set-current-dynamic-state state +@deffnx {C Function} scm_set_current_dynamic_state (state) +Set the current dynamic state object to @var{state} +and return the previous current dynamic state object. +@end deffn + + with-dynamic-state +@c snarfed from fluids.c:582 +@deffn {Scheme Procedure} with-dynamic-state state proc +@deffnx {C Function} scm_with_dynamic_state (state, proc) +Call @var{proc} while @var{state} is the current dynamic +state object. +@end deffn + setvbuf @c snarfed from fports.c:137 @deffn {Scheme Procedure} setvbuf port mode [size] @@ -1388,24 +1750,15 @@ current interfaces. If a file cannot be opened with the access requested, @code{open-file} throws an exception. @end deffn - make-future -@c snarfed from futures.c:89 -@deffn {Scheme Procedure} make-future thunk -@deffnx {C Function} scm_make_future (thunk) -Make a future evaluating THUNK. -@end deffn - - future-ref -@c snarfed from futures.c:221 -@deffn {Scheme Procedure} future-ref future -@deffnx {C Function} scm_future_ref (future) -If the future @var{x} has not been computed yet, compute and -return @var{x}, otherwise just return the previously computed -value. + gc-live-object-stats +@c snarfed from gc.c:276 +@deffn {Scheme Procedure} gc-live-object-stats +@deffnx {C Function} scm_gc_live_object_stats () +Return an alist of statistics of the current live objects. @end deffn gc-stats -@c snarfed from gc.c:283 +@c snarfed from gc.c:293 @deffn {Scheme Procedure} gc-stats @deffnx {C Function} scm_gc_stats () Return an association list of statistics about Guile's current @@ -1414,7 +1767,7 @@ use of storage. @end deffn object-address -@c snarfed from gc.c:419 +@c snarfed from gc.c:429 @deffn {Scheme Procedure} object-address obj @deffnx {C Function} scm_object_address (obj) Return an integer that for the lifetime of @var{obj} is uniquely @@ -1422,15 +1775,22 @@ returned by this function for @var{obj} @end deffn gc -@c snarfed from gc.c:430 +@c snarfed from gc.c:440 @deffn {Scheme Procedure} gc @deffnx {C Function} scm_gc () Scans all of SCM objects and reclaims for further use those that are no longer accessible. @end deffn + class-of +@c snarfed from goops.c:166 +@deffn {Scheme Procedure} class-of x +@deffnx {C Function} scm_class_of (x) +Return the class of @var{x}. +@end deffn + %compute-slots -@c snarfed from goops.c:265 +@c snarfed from goops.c:407 @deffn {Scheme Procedure} %compute-slots class @deffnx {C Function} scm_sys_compute_slots (class) Return a list consisting of the names of all slots belonging to @@ -1439,7 +1799,7 @@ its superclasses. @end deffn get-keyword -@c snarfed from goops.c:356 +@c snarfed from goops.c:498 @deffn {Scheme Procedure} get-keyword key l default_value @deffnx {C Function} scm_get_keyword (key, l, default_value) Determine an associated value for the keyword @var{key} from @@ -1451,7 +1811,7 @@ If @var{l} does not hold a value for @var{key}, the value @end deffn %initialize-object -@c snarfed from goops.c:379 +@c snarfed from goops.c:521 @deffn {Scheme Procedure} %initialize-object obj initargs @deffnx {C Function} scm_sys_initialize_object (obj, initargs) Initialize the object @var{obj} with the given arguments @@ -1459,147 +1819,147 @@ Initialize the object @var{obj} with the given arguments @end deffn %prep-layout! -@c snarfed from goops.c:477 +@c snarfed from goops.c:619 @deffn {Scheme Procedure} %prep-layout! class @deffnx {C Function} scm_sys_prep_layout_x (class) @end deffn %inherit-magic! -@c snarfed from goops.c:576 +@c snarfed from goops.c:718 @deffn {Scheme Procedure} %inherit-magic! class dsupers @deffnx {C Function} scm_sys_inherit_magic_x (class, dsupers) @end deffn instance? -@c snarfed from goops.c:816 +@c snarfed from goops.c:958 @deffn {Scheme Procedure} instance? obj @deffnx {C Function} scm_instance_p (obj) Return @code{#t} if @var{obj} is an instance. @end deffn class-name -@c snarfed from goops.c:831 +@c snarfed from goops.c:973 @deffn {Scheme Procedure} class-name obj @deffnx {C Function} scm_class_name (obj) Return the class name of @var{obj}. @end deffn class-direct-supers -@c snarfed from goops.c:841 +@c snarfed from goops.c:983 @deffn {Scheme Procedure} class-direct-supers obj @deffnx {C Function} scm_class_direct_supers (obj) Return the direct superclasses of the class @var{obj}. @end deffn class-direct-slots -@c snarfed from goops.c:851 +@c snarfed from goops.c:993 @deffn {Scheme Procedure} class-direct-slots obj @deffnx {C Function} scm_class_direct_slots (obj) Return the direct slots of the class @var{obj}. @end deffn class-direct-subclasses -@c snarfed from goops.c:861 +@c snarfed from goops.c:1003 @deffn {Scheme Procedure} class-direct-subclasses obj @deffnx {C Function} scm_class_direct_subclasses (obj) Return the direct subclasses of the class @var{obj}. @end deffn class-direct-methods -@c snarfed from goops.c:871 +@c snarfed from goops.c:1013 @deffn {Scheme Procedure} class-direct-methods obj @deffnx {C Function} scm_class_direct_methods (obj) Return the direct methods of the class @var{obj} @end deffn class-precedence-list -@c snarfed from goops.c:881 +@c snarfed from goops.c:1023 @deffn {Scheme Procedure} class-precedence-list obj @deffnx {C Function} scm_class_precedence_list (obj) Return the class precedence list of the class @var{obj}. @end deffn class-slots -@c snarfed from goops.c:891 +@c snarfed from goops.c:1033 @deffn {Scheme Procedure} class-slots obj @deffnx {C Function} scm_class_slots (obj) Return the slot list of the class @var{obj}. @end deffn class-environment -@c snarfed from goops.c:901 +@c snarfed from goops.c:1043 @deffn {Scheme Procedure} class-environment obj @deffnx {C Function} scm_class_environment (obj) Return the environment of the class @var{obj}. @end deffn generic-function-name -@c snarfed from goops.c:912 +@c snarfed from goops.c:1054 @deffn {Scheme Procedure} generic-function-name obj @deffnx {C Function} scm_generic_function_name (obj) Return the name of the generic function @var{obj}. @end deffn generic-function-methods -@c snarfed from goops.c:957 +@c snarfed from goops.c:1099 @deffn {Scheme Procedure} generic-function-methods obj @deffnx {C Function} scm_generic_function_methods (obj) Return the methods of the generic function @var{obj}. @end deffn method-generic-function -@c snarfed from goops.c:970 +@c snarfed from goops.c:1112 @deffn {Scheme Procedure} method-generic-function obj @deffnx {C Function} scm_method_generic_function (obj) Return the generic function for the method @var{obj}. @end deffn method-specializers -@c snarfed from goops.c:980 +@c snarfed from goops.c:1122 @deffn {Scheme Procedure} method-specializers obj @deffnx {C Function} scm_method_specializers (obj) Return specializers of the method @var{obj}. @end deffn method-procedure -@c snarfed from goops.c:990 +@c snarfed from goops.c:1132 @deffn {Scheme Procedure} method-procedure obj @deffnx {C Function} scm_method_procedure (obj) Return the procedure of the method @var{obj}. @end deffn accessor-method-slot-definition -@c snarfed from goops.c:1000 +@c snarfed from goops.c:1142 @deffn {Scheme Procedure} accessor-method-slot-definition obj @deffnx {C Function} scm_accessor_method_slot_definition (obj) Return the slot definition of the accessor @var{obj}. @end deffn %tag-body -@c snarfed from goops.c:1010 +@c snarfed from goops.c:1152 @deffn {Scheme Procedure} %tag-body body @deffnx {C Function} scm_sys_tag_body (body) Internal GOOPS magic---don't use this function! @end deffn make-unbound -@c snarfed from goops.c:1025 +@c snarfed from goops.c:1167 @deffn {Scheme Procedure} make-unbound @deffnx {C Function} scm_make_unbound () Return the unbound value. @end deffn unbound? -@c snarfed from goops.c:1034 +@c snarfed from goops.c:1176 @deffn {Scheme Procedure} unbound? obj @deffnx {C Function} scm_unbound_p (obj) Return @code{#t} if @var{obj} is unbound. @end deffn assert-bound -@c snarfed from goops.c:1044 +@c snarfed from goops.c:1186 @deffn {Scheme Procedure} assert-bound value obj @deffnx {C Function} scm_assert_bound (value, obj) Return @var{value} if it is bound, and invoke the @@ -1607,7 +1967,7 @@ Return @var{value} if it is bound, and invoke the @end deffn @@assert-bound-ref -@c snarfed from goops.c:1056 +@c snarfed from goops.c:1198 @deffn {Scheme Procedure} @@assert-bound-ref obj index @deffnx {C Function} scm_at_assert_bound_ref (obj, index) Like @code{assert-bound}, but use @var{index} for accessing @@ -1615,14 +1975,14 @@ the value from @var{obj}. @end deffn %fast-slot-ref -@c snarfed from goops.c:1068 +@c snarfed from goops.c:1210 @deffn {Scheme Procedure} %fast-slot-ref obj index @deffnx {C Function} scm_sys_fast_slot_ref (obj, index) Return the slot value with index @var{index} from @var{obj}. @end deffn %fast-slot-set! -@c snarfed from goops.c:1082 +@c snarfed from goops.c:1224 @deffn {Scheme Procedure} %fast-slot-set! obj index value @deffnx {C Function} scm_sys_fast_slot_set_x (obj, index, value) Set the slot with index @var{index} in @var{obj} to @@ -1630,35 +1990,35 @@ Set the slot with index @var{index} in @var{obj} to @end deffn slot-ref-using-class -@c snarfed from goops.c:1219 +@c snarfed from goops.c:1361 @deffn {Scheme Procedure} slot-ref-using-class class obj slot_name @deffnx {C Function} scm_slot_ref_using_class (class, obj, slot_name) @end deffn slot-set-using-class! -@c snarfed from goops.c:1238 +@c snarfed from goops.c:1380 @deffn {Scheme Procedure} slot-set-using-class! class obj slot_name value @deffnx {C Function} scm_slot_set_using_class_x (class, obj, slot_name, value) @end deffn slot-bound-using-class? -@c snarfed from goops.c:1252 +@c snarfed from goops.c:1394 @deffn {Scheme Procedure} slot-bound-using-class? class obj slot_name @deffnx {C Function} scm_slot_bound_using_class_p (class, obj, slot_name) @end deffn slot-exists-using-class? -@c snarfed from goops.c:1267 +@c snarfed from goops.c:1409 @deffn {Scheme Procedure} slot-exists-using-class? class obj slot_name @deffnx {C Function} scm_slot_exists_using_class_p (class, obj, slot_name) @end deffn slot-ref -@c snarfed from goops.c:1283 +@c snarfed from goops.c:1425 @deffn {Scheme Procedure} slot-ref obj slot_name @deffnx {C Function} scm_slot_ref (obj, slot_name) Return the value from @var{obj}'s slot with the name @@ -1666,14 +2026,14 @@ Return the value from @var{obj}'s slot with the name @end deffn slot-set! -@c snarfed from goops.c:1300 +@c snarfed from goops.c:1442 @deffn {Scheme Procedure} slot-set! obj slot_name value @deffnx {C Function} scm_slot_set_x (obj, slot_name, value) Set the slot named @var{slot_name} of @var{obj} to @var{value}. @end deffn slot-bound? -@c snarfed from goops.c:1317 +@c snarfed from goops.c:1459 @deffn {Scheme Procedure} slot-bound? obj slot_name @deffnx {C Function} scm_slot_bound_p (obj, slot_name) Return @code{#t} if the slot named @var{slot_name} of @var{obj} @@ -1681,14 +2041,14 @@ is bound. @end deffn slot-exists? -@c snarfed from goops.c:1335 +@c snarfed from goops.c:1477 @deffn {Scheme Procedure} slot-exists? obj slot_name @deffnx {C Function} scm_slot_exists_p (obj, slot_name) Return @code{#t} if @var{obj} has a slot named @var{slot_name}. @end deffn %allocate-instance -@c snarfed from goops.c:1374 +@c snarfed from goops.c:1516 @deffn {Scheme Procedure} %allocate-instance class initargs @deffnx {C Function} scm_sys_allocate_instance (class, initargs) Create a new instance of class @var{class} and initialize it @@ -1696,63 +2056,63 @@ from the arguments @var{initargs}. @end deffn %set-object-setter! -@c snarfed from goops.c:1444 +@c snarfed from goops.c:1586 @deffn {Scheme Procedure} %set-object-setter! obj setter @deffnx {C Function} scm_sys_set_object_setter_x (obj, setter) @end deffn %modify-instance -@c snarfed from goops.c:1469 +@c snarfed from goops.c:1611 @deffn {Scheme Procedure} %modify-instance old new @deffnx {C Function} scm_sys_modify_instance (old, new) @end deffn %modify-class -@c snarfed from goops.c:1495 +@c snarfed from goops.c:1637 @deffn {Scheme Procedure} %modify-class old new @deffnx {C Function} scm_sys_modify_class (old, new) @end deffn %invalidate-class -@c snarfed from goops.c:1519 +@c snarfed from goops.c:1661 @deffn {Scheme Procedure} %invalidate-class class @deffnx {C Function} scm_sys_invalidate_class (class) @end deffn %invalidate-method-cache! -@c snarfed from goops.c:1641 +@c snarfed from goops.c:1783 @deffn {Scheme Procedure} %invalidate-method-cache! gf @deffnx {C Function} scm_sys_invalidate_method_cache_x (gf) @end deffn generic-capability? -@c snarfed from goops.c:1667 +@c snarfed from goops.c:1809 @deffn {Scheme Procedure} generic-capability? proc @deffnx {C Function} scm_generic_capability_p (proc) @end deffn enable-primitive-generic! -@c snarfed from goops.c:1680 +@c snarfed from goops.c:1822 @deffn {Scheme Procedure} enable-primitive-generic! . subrs @deffnx {C Function} scm_enable_primitive_generic_x (subrs) @end deffn primitive-generic-generic -@c snarfed from goops.c:1701 +@c snarfed from goops.c:1843 @deffn {Scheme Procedure} primitive-generic-generic subr @deffnx {C Function} scm_primitive_generic_generic (subr) @end deffn make -@c snarfed from goops.c:2069 +@c snarfed from goops.c:2209 @deffn {Scheme Procedure} make . args @deffnx {C Function} scm_make (args) Make a new object. @var{args} must contain the class and @@ -1760,21 +2120,21 @@ all necessary initialization information. @end deffn find-method -@c snarfed from goops.c:2158 +@c snarfed from goops.c:2298 @deffn {Scheme Procedure} find-method . l @deffnx {C Function} scm_find_method (l) @end deffn %method-more-specific? -@c snarfed from goops.c:2178 +@c snarfed from goops.c:2318 @deffn {Scheme Procedure} %method-more-specific? m1 m2 targs @deffnx {C Function} scm_sys_method_more_specific_p (m1, m2, targs) - +Return true if method @var{m1} is more specific than @var{m2} given the argument types (classes) listed in @var{targs}. @end deffn %goops-loaded -@c snarfed from goops.c:2793 +@c snarfed from goops.c:2944 @deffn {Scheme Procedure} %goops-loaded @deffnx {C Function} scm_sys_goops_loaded () Announce that GOOPS is loaded and perform initialization @@ -1782,7 +2142,7 @@ on the C level which depends on the loaded GOOPS modules. @end deffn make-guardian -@c snarfed from guardians.c:306 +@c snarfed from guardians.c:307 @deffn {Scheme Procedure} make-guardian [greedy_p] @deffnx {C Function} scm_make_guardian (greedy_p) Create a new guardian. @@ -1813,21 +2173,21 @@ paper still (mostly) accurately describes the interface). @end deffn guardian-destroyed? -@c snarfed from guardians.c:334 +@c snarfed from guardians.c:335 @deffn {Scheme Procedure} guardian-destroyed? guardian @deffnx {C Function} scm_guardian_destroyed_p (guardian) Return @code{#t} if @var{guardian} has been destroyed, otherwise @code{#f}. @end deffn guardian-greedy? -@c snarfed from guardians.c:352 +@c snarfed from guardians.c:353 @deffn {Scheme Procedure} guardian-greedy? guardian @deffnx {C Function} scm_guardian_greedy_p (guardian) Return @code{#t} if @var{guardian} is a greedy guardian, otherwise @code{#f}. @end deffn destroy-guardian! -@c snarfed from guardians.c:363 +@c snarfed from guardians.c:364 @deffn {Scheme Procedure} destroy-guardian! guardian @deffnx {C Function} scm_destroy_guardian_x (guardian) Destroys @var{guardian}, by making it impossible to put any more @@ -1836,7 +2196,7 @@ objects guarded by @var{guardian}. @end deffn hashq -@c snarfed from hash.c:176 +@c snarfed from hash.c:183 @deffn {Scheme Procedure} hashq key size @deffnx {C Function} scm_hashq (key, size) Determine a hash value for @var{key} that is suitable for @@ -1852,7 +2212,7 @@ different values, since @code{foo} will be garbage collected. @end deffn hashv -@c snarfed from hash.c:212 +@c snarfed from hash.c:219 @deffn {Scheme Procedure} hashv key size @deffnx {C Function} scm_hashv (key, size) Determine a hash value for @var{key} that is suitable for @@ -1868,7 +2228,7 @@ different values, since @code{foo} will be garbage collected. @end deffn hash -@c snarfed from hash.c:235 +@c snarfed from hash.c:242 @deffn {Scheme Procedure} hash key size @deffnx {C Function} scm_hash (key, size) Determine a hash value for @var{key} that is suitable for @@ -1878,29 +2238,27 @@ integer in the range 0 to @var{size} - 1. @end deffn make-hash-table -@c snarfed from hashtab.c:309 +@c snarfed from hashtab.c:332 @deffn {Scheme Procedure} make-hash-table [n] @deffnx {C Function} scm_make_hash_table (n) -Make a hash table with optional minimum number of buckets @var{n} +Make a new abstract hash table object with minimum number of buckets @var{n} @end deffn make-weak-key-hash-table -@c snarfed from hashtab.c:328 +@c snarfed from hashtab.c:349 @deffn {Scheme Procedure} make-weak-key-hash-table [n] @deffnx {Scheme Procedure} make-weak-value-hash-table size @deffnx {Scheme Procedure} make-doubly-weak-hash-table size @deffnx {C Function} scm_make_weak_key_hash_table (n) -Return a weak hash table with @var{size} buckets. As with any -hash table, choosing a good size for the table requires some -caution. +Return a weak hash table with @var{size} buckets. You can modify weak hash tables in exactly the same way you would modify regular hash tables. (@pxref{Hash Tables}) @end deffn make-weak-value-hash-table -@c snarfed from hashtab.c:343 +@c snarfed from hashtab.c:364 @deffn {Scheme Procedure} make-weak-value-hash-table [n] @deffnx {C Function} scm_make_weak_value_hash_table (n) Return a hash table with weak values with @var{size} buckets. @@ -1908,7 +2266,7 @@ Return a hash table with weak values with @var{size} buckets. @end deffn make-doubly-weak-hash-table -@c snarfed from hashtab.c:360 +@c snarfed from hashtab.c:381 @deffn {Scheme Procedure} make-doubly-weak-hash-table n @deffnx {C Function} scm_make_doubly_weak_hash_table (n) Return a hash table with weak keys and values with @var{size} @@ -1916,14 +2274,14 @@ buckets. (@pxref{Hash Tables}) @end deffn hash-table? -@c snarfed from hashtab.c:379 +@c snarfed from hashtab.c:400 @deffn {Scheme Procedure} hash-table? obj @deffnx {C Function} scm_hash_table_p (obj) -Return @code{#t} if @var{obj} is a hash table. +Return @code{#t} if @var{obj} is an abstract hash table object. @end deffn weak-key-hash-table? -@c snarfed from hashtab.c:393 +@c snarfed from hashtab.c:414 @deffn {Scheme Procedure} weak-key-hash-table? obj @deffnx {Scheme Procedure} weak-value-hash-table? obj @deffnx {Scheme Procedure} doubly-weak-hash-table? obj @@ -1934,28 +2292,28 @@ nor a weak value hash table. @end deffn weak-value-hash-table? -@c snarfed from hashtab.c:403 +@c snarfed from hashtab.c:424 @deffn {Scheme Procedure} weak-value-hash-table? obj @deffnx {C Function} scm_weak_value_hash_table_p (obj) Return @code{#t} if @var{obj} is a weak value hash table. @end deffn doubly-weak-hash-table? -@c snarfed from hashtab.c:413 +@c snarfed from hashtab.c:434 @deffn {Scheme Procedure} doubly-weak-hash-table? obj @deffnx {C Function} scm_doubly_weak_hash_table_p (obj) Return @code{#t} if @var{obj} is a doubly weak hash table. @end deffn hash-clear! -@c snarfed from hashtab.c:550 +@c snarfed from hashtab.c:586 @deffn {Scheme Procedure} hash-clear! table @deffnx {C Function} scm_hash_clear_x (table) -Remove all items from TABLE (without triggering a resize). +Remove all items from @var{table} (without triggering a resize). @end deffn hashq-get-handle -@c snarfed from hashtab.c:567 +@c snarfed from hashtab.c:607 @deffn {Scheme Procedure} hashq-get-handle table key @deffnx {C Function} scm_hashq_get_handle (table, key) This procedure returns the @code{(key . value)} pair from the @@ -1965,7 +2323,7 @@ Uses @code{eq?} for equality testing. @end deffn hashq-create-handle! -@c snarfed from hashtab.c:579 +@c snarfed from hashtab.c:619 @deffn {Scheme Procedure} hashq-create-handle! table key init @deffnx {C Function} scm_hashq_create_handle_x (table, key, init) This function looks up @var{key} in @var{table} and returns its handle. @@ -1974,7 +2332,7 @@ associates @var{key} with @var{init}. @end deffn hashq-ref -@c snarfed from hashtab.c:592 +@c snarfed from hashtab.c:632 @deffn {Scheme Procedure} hashq-ref table key [dflt] @deffnx {C Function} scm_hashq_ref (table, key, dflt) Look up @var{key} in the hash table @var{table}, and return the @@ -1984,7 +2342,7 @@ is supplied). Uses @code{eq?} for equality testing. @end deffn hashq-set! -@c snarfed from hashtab.c:606 +@c snarfed from hashtab.c:646 @deffn {Scheme Procedure} hashq-set! table key val @deffnx {C Function} scm_hashq_set_x (table, key, val) Find the entry in @var{table} associated with @var{key}, and @@ -1992,7 +2350,7 @@ store @var{value} there. Uses @code{eq?} for equality testing. @end deffn hashq-remove! -@c snarfed from hashtab.c:618 +@c snarfed from hashtab.c:658 @deffn {Scheme Procedure} hashq-remove! table key @deffnx {C Function} scm_hashq_remove_x (table, key) Remove @var{key} (and any value associated with it) from @@ -2000,7 +2358,7 @@ Remove @var{key} (and any value associated with it) from @end deffn hashv-get-handle -@c snarfed from hashtab.c:634 +@c snarfed from hashtab.c:673 @deffn {Scheme Procedure} hashv-get-handle table key @deffnx {C Function} scm_hashv_get_handle (table, key) This procedure returns the @code{(key . value)} pair from the @@ -2010,7 +2368,7 @@ Uses @code{eqv?} for equality testing. @end deffn hashv-create-handle! -@c snarfed from hashtab.c:646 +@c snarfed from hashtab.c:685 @deffn {Scheme Procedure} hashv-create-handle! table key init @deffnx {C Function} scm_hashv_create_handle_x (table, key, init) This function looks up @var{key} in @var{table} and returns its handle. @@ -2019,7 +2377,7 @@ associates @var{key} with @var{init}. @end deffn hashv-ref -@c snarfed from hashtab.c:660 +@c snarfed from hashtab.c:699 @deffn {Scheme Procedure} hashv-ref table key [dflt] @deffnx {C Function} scm_hashv_ref (table, key, dflt) Look up @var{key} in the hash table @var{table}, and return the @@ -2029,7 +2387,7 @@ is supplied). Uses @code{eqv?} for equality testing. @end deffn hashv-set! -@c snarfed from hashtab.c:674 +@c snarfed from hashtab.c:713 @deffn {Scheme Procedure} hashv-set! table key val @deffnx {C Function} scm_hashv_set_x (table, key, val) Find the entry in @var{table} associated with @var{key}, and @@ -2037,7 +2395,7 @@ store @var{value} there. Uses @code{eqv?} for equality testing. @end deffn hashv-remove! -@c snarfed from hashtab.c:685 +@c snarfed from hashtab.c:724 @deffn {Scheme Procedure} hashv-remove! table key @deffnx {C Function} scm_hashv_remove_x (table, key) Remove @var{key} (and any value associated with it) from @@ -2045,7 +2403,7 @@ Remove @var{key} (and any value associated with it) from @end deffn hash-get-handle -@c snarfed from hashtab.c:700 +@c snarfed from hashtab.c:738 @deffn {Scheme Procedure} hash-get-handle table key @deffnx {C Function} scm_hash_get_handle (table, key) This procedure returns the @code{(key . value)} pair from the @@ -2055,7 +2413,7 @@ Uses @code{equal?} for equality testing. @end deffn hash-create-handle! -@c snarfed from hashtab.c:712 +@c snarfed from hashtab.c:750 @deffn {Scheme Procedure} hash-create-handle! table key init @deffnx {C Function} scm_hash_create_handle_x (table, key, init) This function looks up @var{key} in @var{table} and returns its handle. @@ -2064,7 +2422,7 @@ associates @var{key} with @var{init}. @end deffn hash-ref -@c snarfed from hashtab.c:725 +@c snarfed from hashtab.c:763 @deffn {Scheme Procedure} hash-ref table key [dflt] @deffnx {C Function} scm_hash_ref (table, key, dflt) Look up @var{key} in the hash table @var{table}, and return the @@ -2074,7 +2432,7 @@ is supplied). Uses @code{equal?} for equality testing. @end deffn hash-set! -@c snarfed from hashtab.c:740 +@c snarfed from hashtab.c:778 @deffn {Scheme Procedure} hash-set! table key val @deffnx {C Function} scm_hash_set_x (table, key, val) Find the entry in @var{table} associated with @var{key}, and @@ -2083,7 +2441,7 @@ testing. @end deffn hash-remove! -@c snarfed from hashtab.c:752 +@c snarfed from hashtab.c:790 @deffn {Scheme Procedure} hash-remove! table key @deffnx {C Function} scm_hash_remove_x (table, key) Remove @var{key} (and any value associated with it) from @@ -2091,7 +2449,7 @@ Remove @var{key} (and any value associated with it) from @end deffn hashx-get-handle -@c snarfed from hashtab.c:805 +@c snarfed from hashtab.c:831 @deffn {Scheme Procedure} hashx-get-handle hash assoc table key @deffnx {C Function} scm_hashx_get_handle (hash, assoc, table, key) This behaves the same way as the corresponding @@ -2103,7 +2461,7 @@ table size. @code{assoc} must be an associator function, like @end deffn hashx-create-handle! -@c snarfed from hashtab.c:824 +@c snarfed from hashtab.c:850 @deffn {Scheme Procedure} hashx-create-handle! hash assoc table key init @deffnx {C Function} scm_hashx_create_handle_x (hash, assoc, table, key, init) This behaves the same way as the corresponding @@ -2115,7 +2473,7 @@ table size. @code{assoc} must be an associator function, like @end deffn hashx-ref -@c snarfed from hashtab.c:847 +@c snarfed from hashtab.c:873 @deffn {Scheme Procedure} hashx-ref hash assoc table key [dflt] @deffnx {C Function} scm_hashx_ref (hash, assoc, table, key, dflt) This behaves the same way as the corresponding @code{ref} @@ -2130,7 +2488,7 @@ equivalent to @code{hashx-ref hashq assq table key}. @end deffn hashx-set! -@c snarfed from hashtab.c:873 +@c snarfed from hashtab.c:899 @deffn {Scheme Procedure} hashx-set! hash assoc table key val @deffnx {C Function} scm_hashx_set_x (hash, assoc, table, key, val) This behaves the same way as the corresponding @code{set!} @@ -2144,8 +2502,23 @@ that takes two arguments, a key to be hashed and a table size. equivalent to @code{hashx-set! hashq assq table key}. @end deffn + hashx-remove! +@c snarfed from hashtab.c:920 +@deffn {Scheme Procedure} hashx-remove! hash assoc table obj +@deffnx {C Function} scm_hashx_remove_x (hash, assoc, table, obj) +This behaves the same way as the corresponding @code{remove!} +function, but uses @var{hash} as a hash function and +@var{assoc} to compare keys. @code{hash} 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-remove! table key} is +equivalent to @code{hashx-remove! hashq assq #f table key}. +@end deffn + hash-fold -@c snarfed from hashtab.c:975 +@c snarfed from hashtab.c:1009 @deffn {Scheme Procedure} hash-fold proc init table @deffnx {C Function} scm_hash_fold (proc, init, table) An iterator over hash-table elements. @@ -2159,7 +2532,7 @@ table into an a-list of key-value pairs. @end deffn hash-for-each -@c snarfed from hashtab.c:996 +@c snarfed from hashtab.c:1030 @deffn {Scheme Procedure} hash-for-each proc table @deffnx {C Function} scm_hash_for_each (proc, table) An iterator over hash-table elements. @@ -2169,7 +2542,7 @@ and value are successive pairs from the hash table TABLE. @end deffn hash-for-each-handle -@c snarfed from hashtab.c:1013 +@c snarfed from hashtab.c:1047 @deffn {Scheme Procedure} hash-for-each-handle proc table @deffnx {C Function} scm_hash_for_each_handle (proc, table) An iterator over hash-table elements. @@ -2177,7 +2550,7 @@ Applies PROC successively on all hash table handles. @end deffn hash-map->list -@c snarfed from hashtab.c:1039 +@c snarfed from hashtab.c:1073 @deffn {Scheme Procedure} hash-map->list proc table @deffnx {C Function} scm_hash_map_to_list (proc, table) An iterator over hash-table elements. @@ -2252,6 +2625,41 @@ last. The return value of this procedure is not specified. Convert the procedure list of @var{hook} to a list. @end deffn + gettext +@c snarfed from i18n.c:90 +@deffn {Scheme Procedure} gettext msgid [domain [category]] +@deffnx {C Function} scm_gettext (msgid, domain, category) +Return the translation of @var{msgid} in the message domain @var{domain}. @var{domain} is optional and defaults to the domain set through (textdomain). @var{category} is optional and defaults to LC_MESSAGES. +@end deffn + + ngettext +@c snarfed from i18n.c:146 +@deffn {Scheme Procedure} ngettext msgid msgid_plural n [domain [category]] +@deffnx {C Function} scm_ngettext (msgid, msgid_plural, n, domain, category) +Return the translation of @var{msgid}/@var{msgid_plural} in the message domain @var{domain}, with the plural form being chosen appropriately for the number @var{n}. @var{domain} is optional and defaults to the domain set through (textdomain). @var{category} is optional and defaults to LC_MESSAGES. +@end deffn + + textdomain +@c snarfed from i18n.c:209 +@deffn {Scheme Procedure} textdomain [domainname] +@deffnx {C Function} scm_textdomain (domainname) +If optional parameter @var{domainname} is supplied, set the textdomain. Return the textdomain. +@end deffn + + bindtextdomain +@c snarfed from i18n.c:241 +@deffn {Scheme Procedure} bindtextdomain domainname [directory] +@deffnx {C Function} scm_bindtextdomain (domainname, directory) +If optional parameter @var{directory} is supplied, set message catalogs to directory @var{directory}. Return the directory bound to @var{domainname}. +@end deffn + + bind-textdomain-codeset +@c snarfed from i18n.c:280 +@deffn {Scheme Procedure} bind-textdomain-codeset domainname [encoding] +@deffnx {C Function} scm_bind_textdomain_codeset (domainname, encoding) +If optional parameter @var{encoding} is supplied, set encoding for message catalogs of @var{domainname}. Return the encoding of @var{domainname}. +@end deffn + ftell @c snarfed from ioext.c:54 @deffn {Scheme Procedure} ftell fd_port @@ -2353,27 +2761,26 @@ underlying file descriptor, without changing their revealed counts. @end deffn - make-keyword-from-dash-symbol -@c snarfed from keywords.c:52 -@deffn {Scheme Procedure} make-keyword-from-dash-symbol symbol -@deffnx {C Function} scm_make_keyword_from_dash_symbol (symbol) -Make a keyword object from a @var{symbol} that starts with a dash. -@end deffn - keyword? -@c snarfed from keywords.c:91 +@c snarfed from keywords.c:52 @deffn {Scheme Procedure} keyword? obj @deffnx {C Function} scm_keyword_p (obj) Return @code{#t} if the argument @var{obj} is a keyword, else @code{#f}. @end deffn - keyword-dash-symbol -@c snarfed from keywords.c:102 -@deffn {Scheme Procedure} keyword-dash-symbol keyword -@deffnx {C Function} scm_keyword_dash_symbol (keyword) -Return the dash symbol for @var{keyword}. -This is the inverse of @code{make-keyword-from-dash-symbol}. + symbol->keyword +@c snarfed from keywords.c:61 +@deffn {Scheme Procedure} symbol->keyword symbol +@deffnx {C Function} scm_symbol_to_keyword (symbol) +Return the keyword with the same name as @var{symbol}. +@end deffn + + keyword->symbol +@c snarfed from keywords.c:82 +@deffn {Scheme Procedure} keyword->symbol keyword +@deffnx {C Function} scm_keyword_to_symbol (keyword) +Return the symbol with the same name as @var{keyword}. @end deffn list @@ -2683,7 +3090,7 @@ Linear-update variant of @code{filter}. @end deffn primitive-load -@c snarfed from load.c:94 +@c snarfed from load.c:72 @deffn {Scheme Procedure} primitive-load filename @deffnx {C Function} scm_primitive_load (filename) Load the file named @var{filename} and evaluate its contents in @@ -2696,7 +3103,7 @@ documentation for @code{%load-hook} later in this section. @end deffn %package-data-dir -@c snarfed from load.c:134 +@c snarfed from load.c:117 @deffn {Scheme Procedure} %package-data-dir @deffnx {C Function} scm_sys_package_data_dir () Return the name of the directory where Scheme packages, modules and @@ -2705,7 +3112,7 @@ libraries are kept. On most Unix systems, this will be @end deffn %library-dir -@c snarfed from load.c:146 +@c snarfed from load.c:129 @deffn {Scheme Procedure} %library-dir @deffnx {C Function} scm_sys_library_dir () Return the directory where the Guile Scheme library files are installed. @@ -2713,7 +3120,7 @@ E.g., may return "/usr/share/guile/1.3.5". @end deffn %site-dir -@c snarfed from load.c:158 +@c snarfed from load.c:141 @deffn {Scheme Procedure} %site-dir @deffnx {C Function} scm_sys_site_dir () Return the directory where the Guile site files are installed. @@ -2721,7 +3128,7 @@ E.g., may return "/usr/share/guile/site". @end deffn parse-path -@c snarfed from load.c:183 +@c snarfed from load.c:166 @deffn {Scheme Procedure} parse-path path [tail] @deffnx {C Function} scm_parse_path (path, tail) Parse @var{path}, which is expected to be a colon-separated @@ -2731,7 +3138,7 @@ is returned. @end deffn search-path -@c snarfed from load.c:310 +@c snarfed from load.c:293 @deffn {Scheme Procedure} search-path path filename [extensions] @deffnx {C Function} scm_search_path (path, filename, extensions) Search @var{path} for a directory containing a file named @@ -2744,7 +3151,7 @@ concatenated with each @var{extension}. @end deffn %search-load-path -@c snarfed from load.c:447 +@c snarfed from load.c:430 @deffn {Scheme Procedure} %search-load-path filename @deffnx {C Function} scm_sys_search_load_path (filename) Search @var{%load-path} for the file named @var{filename}, @@ -2757,7 +3164,7 @@ will try each extension automatically. @end deffn primitive-load-path -@c snarfed from load.c:468 +@c snarfed from load.c:451 @deffn {Scheme Procedure} primitive-load-path filename @deffnx {C Function} scm_primitive_load_path (filename) Search @var{%load-path} for the file named @var{filename} and @@ -2791,23 +3198,41 @@ result of applying @var{code} to the expression and the environment. @end deffn + procedure->macro +@c snarfed from macros.c:146 +@deffn {Scheme Procedure} procedure->macro code +@deffnx {C Function} scm_makmacro (code) +Return 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. For example: + +@lisp +(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 lisp +@end deffn + macro? @c snarfed from macros.c:165 @deffn {Scheme Procedure} macro? obj @deffnx {C Function} scm_macro_p (obj) -Return @code{#t} if @var{obj} is a regular macro, a memoizing macro or a -syntax transformer. +Return @code{#t} if @var{obj} is a regular macro, a memoizing macro, a +syntax transformer, or a syntax-case macro. @end deffn macro-type @c snarfed from macros.c:186 @deffn {Scheme Procedure} macro-type m @deffnx {C Function} scm_macro_type (m) -Return one of the symbols @code{syntax}, @code{macro} or -@code{macro!}, depending on whether @var{m} is a syntax -transformer, a regular macro, or a memoizing macro, -respectively. If @var{m} is not a macro, @code{#f} is -returned. +Return one of the symbols @code{syntax}, @code{macro}, +@code{macro!}, or @code{syntax-case}, depending on whether +@var{m} is a syntax transformer, a regular macro, a memoizing +macro, or a syntax-case macro, respectively. If @var{m} is +not a macro, @code{#f} is returned. @end deffn macro-name @@ -2851,42 +3276,42 @@ evaluate expressions dynamically typed by the user. @end deffn env-module -@c snarfed from modules.c:261 +@c snarfed from modules.c:266 @deffn {Scheme Procedure} env-module env @deffnx {C Function} scm_env_module (env) Return the module of @var{ENV}, a lexical environment. @end deffn standard-eval-closure -@c snarfed from modules.c:337 +@c snarfed from modules.c:342 @deffn {Scheme Procedure} standard-eval-closure module @deffnx {C Function} scm_standard_eval_closure (module) Return an eval closure for the module @var{module}. @end deffn standard-interface-eval-closure -@c snarfed from modules.c:348 +@c snarfed from modules.c:353 @deffn {Scheme Procedure} standard-interface-eval-closure module @deffnx {C Function} scm_standard_interface_eval_closure (module) Return a interface eval closure for the module @var{module}. Such a closure does not allow new bindings to be added. @end deffn module-import-interface -@c snarfed from modules.c:394 +@c snarfed from modules.c:399 @deffn {Scheme Procedure} module-import-interface module sym @deffnx {C Function} scm_module_import_interface (module, sym) - +Return the module or interface from which @var{sym} is imported in @var{module}. If @var{sym} is not imported (i.e., it is not defined in @var{module} or it is a module-local binding instead of an imported one), then @code{#f} is returned. @end deffn %get-pre-modules-obarray -@c snarfed from modules.c:611 +@c snarfed from modules.c:616 @deffn {Scheme Procedure} %get-pre-modules-obarray @deffnx {C Function} scm_get_pre_modules_obarray () Return the obarray that is used for all new bindings before the module system is booted. The first call to @code{set-current-module} will boot the module system. @end deffn exact? -@c snarfed from numbers.c:461 +@c snarfed from numbers.c:460 @deffn {Scheme Procedure} exact? x @deffnx {C Function} scm_exact_p (x) Return @code{#t} if @var{x} is an exact number, @code{#f} @@ -2894,7 +3319,7 @@ otherwise. @end deffn odd? -@c snarfed from numbers.c:480 +@c snarfed from numbers.c:479 @deffn {Scheme Procedure} odd? n @deffnx {C Function} scm_odd_p (n) Return @code{#t} if @var{n} is an odd number, @code{#f} @@ -2902,7 +3327,7 @@ otherwise. @end deffn even? -@c snarfed from numbers.c:515 +@c snarfed from numbers.c:514 @deffn {Scheme Procedure} even? n @deffnx {C Function} scm_even_p (n) Return @code{#t} if @var{n} is an even number, @code{#f} @@ -2910,7 +3335,7 @@ otherwise. @end deffn inf? -@c snarfed from numbers.c:549 +@c snarfed from numbers.c:548 @deffn {Scheme Procedure} inf? x @deffnx {C Function} scm_inf_p (x) Return @code{#t} if @var{x} is either @samp{+inf.0} @@ -2918,7 +3343,7 @@ or @samp{-inf.0}, @code{#f} otherwise. @end deffn nan? -@c snarfed from numbers.c:565 +@c snarfed from numbers.c:564 @deffn {Scheme Procedure} nan? n @deffnx {C Function} scm_nan_p (n) Return @code{#t} if @var{n} is a NaN, @code{#f} @@ -2926,21 +3351,21 @@ otherwise. @end deffn inf -@c snarfed from numbers.c:635 +@c snarfed from numbers.c:634 @deffn {Scheme Procedure} inf @deffnx {C Function} scm_inf () Return Inf. @end deffn nan -@c snarfed from numbers.c:650 +@c snarfed from numbers.c:649 @deffn {Scheme Procedure} nan @deffnx {C Function} scm_nan () Return NaN. @end deffn abs -@c snarfed from numbers.c:666 +@c snarfed from numbers.c:665 @deffn {Scheme Procedure} abs x @deffnx {C Function} scm_abs (x) Return the absolute value of @var{x}. @@ -2984,24 +3409,28 @@ set in the result if it is set in an odd number of arguments. @end deffn logtest -@c snarfed from numbers.c:1424 +@c snarfed from numbers.c:1428 @deffn {Scheme Procedure} logtest j k @deffnx {C Function} scm_logtest (j, k) -@lisp -(logtest j k) @equiv{} (not (zero? (logand j k))) +Test whether @var{j} and @var{k} have any 1 bits in common. +This is equivalent to @code{(not (zero? (logand j k)))}, but +without actually calculating the @code{logand}, just testing +for non-zero. +@lisp (logtest #b0100 #b1011) @result{} #f (logtest #b0100 #b0111) @result{} #t @end lisp @end deffn logbit? -@c snarfed from numbers.c:1495 +@c snarfed from numbers.c:1501 @deffn {Scheme Procedure} logbit? index j @deffnx {C Function} scm_logbit_p (index, j) -@lisp -(logbit? index j) @equiv{} (logtest (integer-expt 2 index) j) +Test whether bit number @var{index} in @var{j} is set. +@var{index} starts from 0 for the least significant bit. +@lisp (logbit? 0 #b1101) @result{} #t (logbit? 1 #b1101) @result{} #f (logbit? 2 #b1101) @result{} #t @@ -3011,7 +3440,7 @@ set in the result if it is set in an odd number of arguments. @end deffn lognot -@c snarfed from numbers.c:1529 +@c snarfed from numbers.c:1535 @deffn {Scheme Procedure} lognot n @deffnx {C Function} scm_lognot (n) Return the integer which is the ones-complement of the integer @@ -3026,7 +3455,7 @@ argument. @end deffn modulo-expt -@c snarfed from numbers.c:1574 +@c snarfed from numbers.c:1580 @deffn {Scheme Procedure} modulo-expt n k m @deffnx {C Function} scm_modulo_expt (n, k, m) Return @var{n} raised to the integer exponent @@ -3039,22 +3468,26 @@ Return @var{n} raised to the integer exponent @end deffn integer-expt -@c snarfed from numbers.c:1679 +@c snarfed from numbers.c:1689 @deffn {Scheme Procedure} integer-expt n k @deffnx {C Function} scm_integer_expt (n, k) -Return @var{n} raised to the non-negative integer exponent -@var{k}. +Return @var{n} raised to the power @var{k}. @var{k} must be an +exact integer, @var{n} can be any number. + +Negative @var{k} is supported, and results in @math{1/n^abs(k)} +in the usual way. @math{@var{n}^0} is 1, as usual, and that +includes @math{0^0} is 1. @lisp -(integer-expt 2 5) - @result{} 32 -(integer-expt -3 3) - @result{} -27 +(integer-expt 2 5) @result{} 32 +(integer-expt -3 3) @result{} -27 +(integer-expt 5 -3) @result{} 1/125 +(integer-expt 0 0) @result{} 1 @end lisp @end deffn ash -@c snarfed from numbers.c:1785 +@c snarfed from numbers.c:1779 @deffn {Scheme Procedure} ash n cnt @deffnx {C Function} scm_ash (n, cnt) Return @var{n} shifted left by @var{cnt} bits, or shifted right @@ -3079,7 +3512,7 @@ shift dropping bits. @end deffn bit-extract -@c snarfed from numbers.c:1825 +@c snarfed from numbers.c:1870 @deffn {Scheme Procedure} bit-extract n start end @deffnx {C Function} scm_bit_extract (n, start, end) Return the integer composed of the @var{start} (inclusive) @@ -3095,7 +3528,7 @@ through @var{end} (exclusive) bits of @var{n}. The @end deffn logcount -@c snarfed from numbers.c:1904 +@c snarfed from numbers.c:1949 @deffn {Scheme Procedure} logcount n @deffnx {C Function} scm_logcount (n) Return the number of bits in integer @var{n}. If integer is @@ -3114,7 +3547,7 @@ representation are counted. If 0, 0 is returned. @end deffn integer-length -@c snarfed from numbers.c:1952 +@c snarfed from numbers.c:1997 @deffn {Scheme Procedure} integer-length n @deffnx {C Function} scm_integer_length (n) Return the number of bits necessary to represent @var{n}. @@ -3130,7 +3563,7 @@ Return the number of bits necessary to represent @var{n}. @end deffn number->string -@c snarfed from numbers.c:2275 +@c snarfed from numbers.c:2337 @deffn {Scheme Procedure} number->string n [radix] @deffnx {C Function} scm_number_to_string (n, radix) Return a string holding the external representation of the @@ -3139,7 +3572,7 @@ inexact, a radix of 10 will be used. @end deffn string->number -@c snarfed from numbers.c:2958 +@c snarfed from numbers.c:3034 @deffn {Scheme Procedure} string->number string [radix] @deffnx {C Function} scm_string_to_number (string, radix) Return a number of the maximally precise representation @@ -3153,7 +3586,7 @@ syntactically valid notation for a number, then @end deffn number? -@c snarfed from numbers.c:3021 +@c snarfed from numbers.c:3097 @deffn {Scheme Procedure} number? x @deffnx {C Function} scm_number_p (x) Return @code{#t} if @var{x} is a number, @code{#f} @@ -3161,7 +3594,7 @@ otherwise. @end deffn complex? -@c snarfed from numbers.c:3034 +@c snarfed from numbers.c:3110 @deffn {Scheme Procedure} complex? x @deffnx {C Function} scm_complex_p (x) Return @code{#t} if @var{x} is a complex number, @code{#f} @@ -3172,7 +3605,7 @@ rational or integer number. @end deffn real? -@c snarfed from numbers.c:3047 +@c snarfed from numbers.c:3123 @deffn {Scheme Procedure} real? x @deffnx {C Function} scm_real_p (x) Return @code{#t} if @var{x} is a real number, @code{#f} @@ -3182,7 +3615,7 @@ fulfilled if @var{x} is an integer number. @end deffn rational? -@c snarfed from numbers.c:3060 +@c snarfed from numbers.c:3136 @deffn {Scheme Procedure} rational? x @deffnx {C Function} scm_rational_p (x) Return @code{#t} if @var{x} is a rational number, @code{#f} @@ -3192,7 +3625,7 @@ fulfilled if @var{x} is an integer number. @end deffn integer? -@c snarfed from numbers.c:3083 +@c snarfed from numbers.c:3159 @deffn {Scheme Procedure} integer? x @deffnx {C Function} scm_integer_p (x) Return @code{#t} if @var{x} is an integer number, @code{#f} @@ -3200,7 +3633,7 @@ else. @end deffn inexact? -@c snarfed from numbers.c:3108 +@c snarfed from numbers.c:3185 @deffn {Scheme Procedure} inexact? x @deffnx {C Function} scm_inexact_p (x) Return @code{#t} if @var{x} is an inexact number, @code{#f} @@ -3208,35 +3641,35 @@ else. @end deffn truncate -@c snarfed from numbers.c:4955 +@c snarfed from numbers.c:5060 @deffn {Scheme Procedure} truncate x @deffnx {C Function} scm_truncate_number (x) Round the number @var{x} towards zero. @end deffn round -@c snarfed from numbers.c:4971 +@c snarfed from numbers.c:5076 @deffn {Scheme Procedure} round x @deffnx {C Function} scm_round_number (x) Round the number @var{x} towards the nearest integer. When it is exactly halfway between two integers, round towards the even one. @end deffn floor -@c snarfed from numbers.c:4997 +@c snarfed from numbers.c:5102 @deffn {Scheme Procedure} floor x @deffnx {C Function} scm_floor (x) Round the number @var{x} towards minus infinity. @end deffn ceiling -@c snarfed from numbers.c:5028 +@c snarfed from numbers.c:5133 @deffn {Scheme Procedure} ceiling x @deffnx {C Function} scm_ceiling (x) Round the number @var{x} towards infinity. @end deffn $expt -@c snarfed from numbers.c:5137 +@c snarfed from numbers.c:5242 @deffn {Scheme Procedure} $expt x y @deffnx {C Function} scm_sys_expt (x, y) Return @var{x} raised to the power of @var{y}. This @@ -3244,7 +3677,7 @@ procedure does not accept complex arguments. @end deffn $atan2 -@c snarfed from numbers.c:5153 +@c snarfed from numbers.c:5258 @deffn {Scheme Procedure} $atan2 x y @deffnx {C Function} scm_sys_atan2 (x, y) Return the arc tangent of the two arguments @var{x} and @@ -3255,64 +3688,56 @@ procedure does not accept complex arguments. @end deffn make-rectangular -@c snarfed from numbers.c:5181 -@deffn {Scheme Procedure} make-rectangular real imaginary -@deffnx {C Function} scm_make_rectangular (real, imaginary) -Return a complex number constructed of the given @var{real} and -@var{imaginary} parts. +@c snarfed from numbers.c:5286 +@deffn {Scheme Procedure} make-rectangular real_part imaginary_part +@deffnx {C Function} scm_make_rectangular (real_part, imaginary_part) +Return a complex number constructed of the given @var{real-part} and @var{imaginary-part} parts. @end deffn make-polar -@c snarfed from numbers.c:5205 +@c snarfed from numbers.c:5310 @deffn {Scheme Procedure} make-polar x y @deffnx {C Function} scm_make_polar (x, y) Return the complex number @var{x} * e^(i * @var{y}). @end deffn inexact->exact -@c snarfed from numbers.c:5408 +@c snarfed from numbers.c:5513 @deffn {Scheme Procedure} inexact->exact z @deffnx {C Function} scm_inexact_to_exact (z) Return an exact number that is numerically closest to @var{z}. @end deffn rationalize -@c snarfed from numbers.c:5445 +@c snarfed from numbers.c:5550 @deffn {Scheme Procedure} rationalize x err @deffnx {C Function} scm_rationalize (x, err) Return an exact number that is within @var{err} of @var{x}. @end deffn - class-of -@c snarfed from objects.c:62 -@deffn {Scheme Procedure} class-of x -@deffnx {C Function} scm_class_of (x) -Return the class of @var{x}. -@end deffn - entity? -@c snarfed from objects.c:342 +@c snarfed from objects.c:192 @deffn {Scheme Procedure} entity? obj @deffnx {C Function} scm_entity_p (obj) Return @code{#t} if @var{obj} is an entity. @end deffn operator? -@c snarfed from objects.c:351 +@c snarfed from objects.c:201 @deffn {Scheme Procedure} operator? obj @deffnx {C Function} scm_operator_p (obj) Return @code{#t} if @var{obj} is an operator. @end deffn valid-object-procedure? -@c snarfed from objects.c:367 +@c snarfed from objects.c:217 @deffn {Scheme Procedure} valid-object-procedure? proc @deffnx {C Function} scm_valid_object_procedure_p (proc) Return @code{#t} iff @var{proc} is a procedure that can be used with @code{set-object-procedure}. It is always valid to use a closure constructed by @code{lambda}. @end deffn set-object-procedure! -@c snarfed from objects.c:389 +@c snarfed from objects.c:239 @deffn {Scheme Procedure} set-object-procedure! obj proc @deffnx {C Function} scm_set_object_procedure_x (obj, proc) Set the object procedure of @var{obj} to @var{proc}. @@ -3320,7 +3745,7 @@ Set the object procedure of @var{obj} to @var{proc}. @end deffn make-class-object -@c snarfed from objects.c:449 +@c snarfed from objects.c:299 @deffn {Scheme Procedure} make-class-object metaclass layout @deffnx {C Function} scm_make_class_object (metaclass, layout) Create a new class object of class @var{metaclass}, with the @@ -3328,7 +3753,7 @@ slot layout specified by @var{layout}. @end deffn make-subclass-object -@c snarfed from objects.c:464 +@c snarfed from objects.c:314 @deffn {Scheme Procedure} make-subclass-object class layout @deffnx {C Function} scm_make_subclass_object (class, layout) Create a subclass object of @var{class}, with the slot layout @@ -3336,28 +3761,28 @@ specified by @var{layout}. @end deffn object-properties -@c snarfed from objprop.c:35 +@c snarfed from objprop.c:36 @deffn {Scheme Procedure} object-properties obj @deffnx {C Function} scm_object_properties (obj) Return @var{obj}'s property list. @end deffn set-object-properties! -@c snarfed from objprop.c:45 +@c snarfed from objprop.c:46 @deffn {Scheme Procedure} set-object-properties! obj alist @deffnx {C Function} scm_set_object_properties_x (obj, alist) Set @var{obj}'s property list to @var{alist}. @end deffn object-property -@c snarfed from objprop.c:56 +@c snarfed from objprop.c:57 @deffn {Scheme Procedure} object-property obj key @deffnx {C Function} scm_object_property (obj, key) Return the property of @var{obj} with name @var{key}. @end deffn set-object-property! -@c snarfed from objprop.c:68 +@c snarfed from objprop.c:69 @deffn {Scheme Procedure} set-object-property! obj key value @deffnx {C Function} scm_set_object_property_x (obj, key, value) In @var{obj}'s property list, set the property named @var{key} @@ -3382,7 +3807,7 @@ Return @code{#t} if @var{x} is a pair; otherwise return @end deffn set-car! -@c snarfed from pairs.c:85 +@c snarfed from pairs.c:120 @deffn {Scheme Procedure} set-car! pair value @deffnx {C Function} scm_set_car_x (pair, value) Stores @var{value} in the car field of @var{pair}. The value returned @@ -3390,7 +3815,7 @@ by @code{set-car!} is unspecified. @end deffn set-cdr! -@c snarfed from pairs.c:98 +@c snarfed from pairs.c:133 @deffn {Scheme Procedure} set-cdr! pair value @deffnx {C Function} scm_set_cdr_x (pair, value) Stores @var{value} in the cdr field of @var{pair}. The value returned @@ -3398,7 +3823,7 @@ by @code{set-cdr!} is unspecified. @end deffn char-ready? -@c snarfed from ports.c:242 +@c snarfed from ports.c:245 @deffn {Scheme Procedure} char-ready? [port] @deffnx {C Function} scm_char_ready_p (port) Return @code{#t} if a character is ready on input @var{port} @@ -3418,7 +3843,7 @@ interactive port that has no ready characters. @end deffn drain-input -@c snarfed from ports.c:319 +@c snarfed from ports.c:322 @deffn {Scheme Procedure} drain-input port @deffnx {C Function} scm_drain_input (port) This procedure clears a port's input buffers, similar @@ -3438,7 +3863,7 @@ for further input. @end deffn current-input-port -@c snarfed from ports.c:347 +@c snarfed from ports.c:355 @deffn {Scheme Procedure} current-input-port @deffnx {C Function} scm_current_input_port () Return the current input port. This is the default port used @@ -3447,7 +3872,7 @@ returns the @dfn{standard input} in Unix and C terminology. @end deffn current-output-port -@c snarfed from ports.c:359 +@c snarfed from ports.c:367 @deffn {Scheme Procedure} current-output-port @deffnx {C Function} scm_current_output_port () Return the current output port. This is the default port used @@ -3457,7 +3882,7 @@ Unix and C terminology. @end deffn current-error-port -@c snarfed from ports.c:369 +@c snarfed from ports.c:377 @deffn {Scheme Procedure} current-error-port @deffnx {C Function} scm_current_error_port () Return the port to which errors and warnings should be sent (the @@ -3465,7 +3890,7 @@ Return the port to which errors and warnings should be sent (the @end deffn current-load-port -@c snarfed from ports.c:379 +@c snarfed from ports.c:387 @deffn {Scheme Procedure} current-load-port @deffnx {C Function} scm_current_load_port () Return the current-load-port. @@ -3473,7 +3898,7 @@ The load port is used internally by @code{primitive-load}. @end deffn set-current-input-port -@c snarfed from ports.c:392 +@c snarfed from ports.c:400 @deffn {Scheme Procedure} set-current-input-port port @deffnx {Scheme Procedure} set-current-output-port port @deffnx {Scheme Procedure} set-current-error-port port @@ -3484,28 +3909,28 @@ so that they use the supplied @var{port} for input or output. @end deffn set-current-output-port -@c snarfed from ports.c:405 +@c snarfed from ports.c:413 @deffn {Scheme Procedure} set-current-output-port port @deffnx {C Function} scm_set_current_output_port (port) Set the current default output port to @var{port}. @end deffn set-current-error-port -@c snarfed from ports.c:419 +@c snarfed from ports.c:427 @deffn {Scheme Procedure} set-current-error-port port @deffnx {C Function} scm_set_current_error_port (port) Set the current default error port to @var{port}. @end deffn port-revealed -@c snarfed from ports.c:639 +@c snarfed from ports.c:625 @deffn {Scheme Procedure} port-revealed port @deffnx {C Function} scm_port_revealed (port) Return the revealed count for @var{port}. @end deffn set-port-revealed! -@c snarfed from ports.c:652 +@c snarfed from ports.c:638 @deffn {Scheme Procedure} set-port-revealed! port rcount @deffnx {C Function} scm_set_port_revealed_x (port, rcount) Sets the revealed count for a port to a given value. @@ -3513,7 +3938,7 @@ The return value is unspecified. @end deffn port-mode -@c snarfed from ports.c:713 +@c snarfed from ports.c:699 @deffn {Scheme Procedure} port-mode port @deffnx {C Function} scm_port_mode (port) Return the port modes associated with the open port @var{port}. @@ -3523,7 +3948,7 @@ used only during port creation are not retained. @end deffn close-port -@c snarfed from ports.c:750 +@c snarfed from ports.c:736 @deffn {Scheme Procedure} close-port port @deffnx {C Function} scm_close_port (port) Close the specified port object. Return @code{#t} if it @@ -3535,7 +3960,7 @@ descriptors. @end deffn close-input-port -@c snarfed from ports.c:780 +@c snarfed from ports.c:766 @deffn {Scheme Procedure} close-input-port port @deffnx {C Function} scm_close_input_port (port) Close the specified input port object. The routine has no effect if @@ -3547,7 +3972,7 @@ which can close file descriptors. @end deffn close-output-port -@c snarfed from ports.c:795 +@c snarfed from ports.c:781 @deffn {Scheme Procedure} close-output-port port @deffnx {C Function} scm_close_output_port (port) Close the specified output port object. The routine has no effect if @@ -3559,7 +3984,7 @@ which can close file descriptors. @end deffn port-for-each -@c snarfed from ports.c:841 +@c snarfed from ports.c:827 @deffn {Scheme Procedure} port-for-each proc @deffnx {C Function} scm_port_for_each (proc) Apply @var{proc} to each port in the Guile port table @@ -3571,7 +3996,7 @@ have no effect as far as @var{port-for-each} is concerned. @end deffn input-port? -@c snarfed from ports.c:859 +@c snarfed from ports.c:845 @deffn {Scheme Procedure} input-port? x @deffnx {C Function} scm_input_port_p (x) Return @code{#t} if @var{x} is an input port, otherwise return @@ -3580,7 +4005,7 @@ Return @code{#t} if @var{x} is an input port, otherwise return @end deffn output-port? -@c snarfed from ports.c:870 +@c snarfed from ports.c:856 @deffn {Scheme Procedure} output-port? x @deffnx {C Function} scm_output_port_p (x) Return @code{#t} if @var{x} is an output port, otherwise return @@ -3589,7 +4014,7 @@ Return @code{#t} if @var{x} is an output port, otherwise return @end deffn port? -@c snarfed from ports.c:882 +@c snarfed from ports.c:868 @deffn {Scheme Procedure} port? x @deffnx {C Function} scm_port_p (x) Return a boolean indicating whether @var{x} is a port. @@ -3598,7 +4023,7 @@ Equivalent to @code{(or (input-port? @var{x}) (output-port? @end deffn port-closed? -@c snarfed from ports.c:892 +@c snarfed from ports.c:878 @deffn {Scheme Procedure} port-closed? port @deffnx {C Function} scm_port_closed_p (port) Return @code{#t} if @var{port} is closed or @code{#f} if it is @@ -3606,7 +4031,7 @@ open. @end deffn eof-object? -@c snarfed from ports.c:903 +@c snarfed from ports.c:889 @deffn {Scheme Procedure} eof-object? x @deffnx {C Function} scm_eof_object_p (x) Return @code{#t} if @var{x} is an end-of-file object; otherwise @@ -3614,7 +4039,7 @@ return @code{#f}. @end deffn force-output -@c snarfed from ports.c:917 +@c snarfed from ports.c:903 @deffn {Scheme Procedure} force-output [port] @deffnx {C Function} scm_force_output (port) Flush the specified output port, or the current output port if @var{port} @@ -3627,7 +4052,7 @@ The return value is unspecified. @end deffn flush-all-ports -@c snarfed from ports.c:935 +@c snarfed from ports.c:921 @deffn {Scheme Procedure} flush-all-ports @deffnx {C Function} scm_flush_all_ports () Equivalent to calling @code{force-output} on @@ -3635,7 +4060,7 @@ all open output ports. The return value is unspecified. @end deffn read-char -@c snarfed from ports.c:955 +@c snarfed from ports.c:941 @deffn {Scheme Procedure} read-char [port] @deffnx {C Function} scm_read_char (port) Return the next character available from @var{port}, updating @@ -3644,7 +4069,7 @@ characters are available, the end-of-file object is returned. @end deffn peek-char -@c snarfed from ports.c:1281 +@c snarfed from ports.c:1283 @deffn {Scheme Procedure} peek-char [port] @deffnx {C Function} scm_peek_char (port) Return the next character available from @var{port}, @@ -3664,7 +4089,7 @@ to @code{read-char} would have hung. @end deffn unread-char -@c snarfed from ports.c:1304 +@c snarfed from ports.c:1306 @deffn {Scheme Procedure} unread-char cobj [port] @deffnx {C Function} scm_unread_char (cobj, port) Place @var{char} in @var{port} so that it will be read by the @@ -3674,7 +4099,7 @@ not supplied, the current input port is used. @end deffn unread-string -@c snarfed from ports.c:1327 +@c snarfed from ports.c:1329 @deffn {Scheme Procedure} unread-string str port @deffnx {C Function} scm_unread_string (str, port) Place the string @var{str} in @var{port} so that its characters will be @@ -3684,7 +4109,7 @@ unread characters will be read again in last-in first-out order. If @end deffn seek -@c snarfed from ports.c:1366 +@c snarfed from ports.c:1368 @deffn {Scheme Procedure} seek fd_port offset whence @deffnx {C Function} scm_seek (fd_port, offset, whence) Sets the current position of @var{fd/port} to the integer @@ -3713,7 +4138,7 @@ that the current position of a port can be obtained using: @end deffn truncate-file -@c snarfed from ports.c:1424 +@c snarfed from ports.c:1426 @deffn {Scheme Procedure} truncate-file object [length] @deffnx {C Function} scm_truncate_file (object, length) Truncates the object referred to by @var{object} to at most @@ -3725,7 +4150,7 @@ position. The return value is unspecified. @end deffn port-line -@c snarfed from ports.c:1484 +@c snarfed from ports.c:1486 @deffn {Scheme Procedure} port-line port @deffnx {C Function} scm_port_line (port) Return the current line number for @var{port}. @@ -3737,7 +4162,7 @@ non-programmers. @end deffn set-port-line! -@c snarfed from ports.c:1496 +@c snarfed from ports.c:1498 @deffn {Scheme Procedure} set-port-line! port line @deffnx {C Function} scm_set_port_line_x (port, line) Set the current line number for @var{port} to @var{line}. The @@ -3745,7 +4170,7 @@ first line of a file is 0. @end deffn port-column -@c snarfed from ports.c:1515 +@c snarfed from ports.c:1517 @deffn {Scheme Procedure} port-column port @deffnx {C Function} scm_port_column (port) Return the current column number of @var{port}. @@ -3759,7 +4184,7 @@ what non-programmers will find most natural.) @end deffn set-port-column! -@c snarfed from ports.c:1527 +@c snarfed from ports.c:1529 @deffn {Scheme Procedure} set-port-column! port column @deffnx {C Function} scm_set_port_column_x (port, column) Set the current column of @var{port}. Before reading the first @@ -3767,7 +4192,7 @@ character on a line the column should be 0. @end deffn port-filename -@c snarfed from ports.c:1541 +@c snarfed from ports.c:1543 @deffn {Scheme Procedure} port-filename port @deffnx {C Function} scm_port_filename (port) Return the filename associated with @var{port}. This function returns @@ -3776,7 +4201,7 @@ when called on the current input, output and error ports respectively. @end deffn set-port-filename! -@c snarfed from ports.c:1555 +@c snarfed from ports.c:1557 @deffn {Scheme Procedure} set-port-filename! port filename @deffnx {C Function} scm_set_port_filename_x (port, filename) Change the filename associated with @var{port}, using the current input @@ -3786,7 +4211,7 @@ source of data, but only the value that is returned by @end deffn %make-void-port -@c snarfed from ports.c:1649 +@c snarfed from ports.c:1651 @deffn {Scheme Procedure} %make-void-port mode @deffnx {C Function} scm_sys_make_void_port (mode) Create and return a new void port. A void port acts like @@ -3796,7 +4221,7 @@ documentation for @code{open-file} in @ref{File Ports}. @end deffn print-options-interface -@c snarfed from print.c:83 +@c snarfed from print.c:87 @deffn {Scheme Procedure} print-options-interface [setting] @deffnx {C Function} scm_print_options (setting) Option interface for the print options. Instead of using @@ -3806,7 +4231,7 @@ and @code{print-options}. @end deffn simple-format -@c snarfed from print.c:914 +@c snarfed from print.c:929 @deffn {Scheme Procedure} simple-format destination message . args @deffnx {C Function} scm_simple_format (destination, message, args) Write @var{message} to @var{destination}, defaulting to @@ -3823,7 +4248,7 @@ containing the formatted text. Does not add a trailing newline. @end deffn newline -@c snarfed from print.c:1004 +@c snarfed from print.c:1019 @deffn {Scheme Procedure} newline [port] @deffnx {C Function} scm_newline (port) Send a newline to @var{port}. @@ -3831,14 +4256,14 @@ If @var{port} is omitted, send to the current output port. @end deffn write-char -@c snarfed from print.c:1019 +@c snarfed from print.c:1034 @deffn {Scheme Procedure} write-char chr [port] @deffnx {C Function} scm_write_char (chr, port) Send character @var{chr} to @var{port}. @end deffn port-with-print-state -@c snarfed from print.c:1073 +@c snarfed from print.c:1088 @deffn {Scheme Procedure} port-with-print-state port [pstate] @deffnx {C Function} scm_port_with_print_state (port, pstate) Create a new port which behaves like @var{port}, but with an @@ -3848,7 +4273,7 @@ a print state, the old print state is reused. @end deffn get-print-state -@c snarfed from print.c:1086 +@c snarfed from print.c:1101 @deffn {Scheme Procedure} get-print-state port @deffnx {C Function} scm_get_print_state (port) Return the print state of the port @var{port}. If @var{port} @@ -3935,8 +4360,8 @@ with the associated setter @var{setter}. @c snarfed from procs.c:308 @deffn {Scheme Procedure} procedure proc @deffnx {C Function} scm_procedure (proc) -Return the procedure of @var{proc}, which must be either a -procedure with setter, or an operator struct. +Return the procedure of @var{proc}, which must be an +applicable struct. @end deffn primitive-make-property @@ -3978,7 +4403,7 @@ Remove any value associated with @var{prop} and @var{obj}. @end deffn random -@c snarfed from random.c:346 +@c snarfed from random.c:347 @deffn {Scheme Procedure} random n [state] @deffnx {C Function} scm_random (n, state) Return a number in [0, N). @@ -3996,21 +4421,21 @@ as a side effect of the random operation. @end deffn copy-random-state -@c snarfed from random.c:371 +@c snarfed from random.c:372 @deffn {Scheme Procedure} copy-random-state [state] @deffnx {C Function} scm_copy_random_state (state) Return a copy of the random state @var{state}. @end deffn seed->random-state -@c snarfed from random.c:383 +@c snarfed from random.c:384 @deffn {Scheme Procedure} seed->random-state seed @deffnx {C Function} scm_seed_to_random_state (seed) Return a new random state using @var{seed}. @end deffn random:uniform -@c snarfed from random.c:401 +@c snarfed from random.c:402 @deffn {Scheme Procedure} random:uniform [state] @deffnx {C Function} scm_random_uniform (state) Return a uniformly distributed inexact real random number in @@ -4018,7 +4443,7 @@ Return a uniformly distributed inexact real random number in @end deffn random:normal -@c snarfed from random.c:416 +@c snarfed from random.c:417 @deffn {Scheme Procedure} random:normal [state] @deffnx {C Function} scm_random_normal (state) Return an inexact real in a normal distribution. The @@ -4028,19 +4453,18 @@ normal distribution with mean m and standard deviation d use @end deffn random:solid-sphere! -@c snarfed from random.c:472 +@c snarfed from random.c:500 @deffn {Scheme Procedure} random:solid-sphere! v [state] @deffnx {C Function} scm_random_solid_sphere_x (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-sphere. -The sum of the squares of the numbers is returned. +Fills @var{vect} with inexact real random numbers the sum of +whose squares is less than 1.0. Thinking of @var{vect} as +coordinates in space of dimension @var{n} @math{=} +@code{(vector-length @var{vect})}, the coordinates are +uniformly distributed within the unit @var{n}-sphere. @end deffn random:hollow-sphere! -@c snarfed from random.c:495 +@c snarfed from random.c:522 @deffn {Scheme Procedure} random:hollow-sphere! v [state] @deffnx {C Function} scm_random_hollow_sphere_x (v, state) Fills vect with inexact real random numbers @@ -4052,7 +4476,7 @@ unit n-sphere. @end deffn random:normal-vector! -@c snarfed from random.c:513 +@c snarfed from random.c:539 @deffn {Scheme Procedure} random:normal-vector! v [state] @deffnx {C Function} scm_random_normal_vector_x (v, state) Fills vect with inexact real random numbers that are @@ -4061,7 +4485,7 @@ independent and standard normally distributed @end deffn random:exp -@c snarfed from random.c:538 +@c snarfed from random.c:577 @deffn {Scheme Procedure} random:exp [state] @deffnx {C Function} scm_random_exp (state) Return an inexact real in an exponential distribution with mean @@ -4116,7 +4540,7 @@ used. This function is equivalent to: @end deffn read-options-interface -@c snarfed from read.c:109 +@c snarfed from read.c:110 @deffn {Scheme Procedure} read-options-interface [setting] @deffnx {C Function} scm_read_options (setting) Option interface for the read options. Instead of using @@ -4125,7 +4549,7 @@ this procedure directly, use the procedures @code{read-enable}, @end deffn read -@c snarfed from read.c:129 +@c snarfed from read.c:130 @deffn {Scheme Procedure} read [port] @deffnx {C Function} scm_read (port) Read an s-expression from the input port @var{port}, or from @@ -4134,73 +4558,33 @@ Any whitespace before the next token is discarded. @end deffn read-hash-extend -@c snarfed from read.c:866 +@c snarfed from read.c:898 @deffn {Scheme Procedure} read-hash-extend chr proc @deffnx {C Function} scm_read_hash_extend (chr, proc) Install the procedure @var{proc} for reading expressions starting with the character sequence @code{#} and @var{chr}. @var{proc} will be called with two arguments: the character @var{chr} and the port to read further data from. The object -returned will be the return value of @code{read}. +returned will be the return value of @code{read}. +Passing @code{#f} for @var{proc} will remove a previous setting. + @end deffn call-with-dynamic-root -@c snarfed from root.c:320 +@c snarfed from root.c:160 @deffn {Scheme Procedure} call-with-dynamic-root thunk handler @deffnx {C Function} scm_call_with_dynamic_root (thunk, handler) -Evaluate @code{(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: - -@lisp -;; Almost certainly a bug: -(with-output-to-port - some-port - - (lambda () - (call-with-dynamic-root - (lambda () - (display 'fnord) - (newline)) - (lambda (errcode) errcode)))) -@end lisp - -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.) +Call @var{thunk} with a new dynamic state and withina continuation barrier. The @var{handler} catches allotherwise uncaught throws and executes within the samedynamic context as @var{thunk}. @end deffn dynamic-root -@c snarfed from root.c:333 +@c snarfed from root.c:171 @deffn {Scheme Procedure} dynamic-root @deffnx {C Function} scm_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. + @end deffn read-string!/partial @@ -4294,7 +4678,7 @@ return 0 immediately if the request size is 0 bytes. @end deffn sigaction -@c snarfed from scmsigs.c:285 +@c snarfed from scmsigs.c:253 @deffn {Scheme Procedure} sigaction signum [handler [flags [thread]]] @deffnx {C Function} scm_sigaction_for_thread (signum, handler, flags, thread) Install or report the signal handler for a specified signal. @@ -4329,7 +4713,7 @@ structures. @end deffn restore-signals -@c snarfed from scmsigs.c:456 +@c snarfed from scmsigs.c:427 @deffn {Scheme Procedure} restore-signals @deffnx {C Function} scm_restore_signals () Return all signal handlers to the values they had before any call to @@ -4337,7 +4721,7 @@ Return all signal handlers to the values they had before any call to @end deffn alarm -@c snarfed from scmsigs.c:493 +@c snarfed from scmsigs.c:464 @deffn {Scheme Procedure} alarm i @deffnx {C Function} scm_alarm (i) Set a timer to raise a @code{SIGALRM} signal after the specified @@ -4352,7 +4736,7 @@ no previous alarm, the return value is zero. @end deffn setitimer -@c snarfed from scmsigs.c:520 +@c snarfed from scmsigs.c:491 @deffn {Scheme Procedure} setitimer which_timer interval_seconds interval_microseconds value_seconds value_microseconds @deffnx {C Function} scm_setitimer (which_timer, interval_seconds, interval_microseconds, value_seconds, value_microseconds) Set the timer specified by @var{which_timer} according to the given @@ -4373,7 +4757,7 @@ the seconds and microseconds of the timer @code{it_value}. @end deffn getitimer -@c snarfed from scmsigs.c:561 +@c snarfed from scmsigs.c:532 @deffn {Scheme Procedure} getitimer which_timer @deffnx {C Function} scm_getitimer (which_timer) Return information about the timer specified by @var{which_timer} @@ -4390,7 +4774,7 @@ the seconds and microseconds of the timer @code{it_value}. @end deffn pause -@c snarfed from scmsigs.c:588 +@c snarfed from scmsigs.c:559 @deffn {Scheme Procedure} pause @deffnx {C Function} scm_pause () Pause the current process (thread?) until a signal arrives whose @@ -4399,7 +4783,7 @@ handler procedure. The return value is unspecified. @end deffn sleep -@c snarfed from scmsigs.c:601 +@c snarfed from scmsigs.c:572 @deffn {Scheme Procedure} sleep i @deffnx {C Function} scm_sleep (i) Wait for the given number of seconds (an integer) or until a signal @@ -4408,14 +4792,14 @@ of seconds remaining otherwise. @end deffn usleep -@c snarfed from scmsigs.c:610 +@c snarfed from scmsigs.c:581 @deffn {Scheme Procedure} usleep i @deffnx {C Function} scm_usleep (i) Sleep for @var{i} microseconds. @end deffn raise -@c snarfed from scmsigs.c:620 +@c snarfed from scmsigs.c:591 @deffn {Scheme Procedure} raise sig @deffnx {C Function} scm_raise (sig) Sends a specified signal @var{sig} to the current process, where @@ -4477,17 +4861,18 @@ is @var{status} if supplied, otherwise zero. @end deffn restricted-vector-sort! -@c snarfed from sort.c:291 +@c snarfed from sort.c:78 @deffn {Scheme Procedure} restricted-vector-sort! vec less startpos endpos @deffnx {C Function} scm_restricted_vector_sort_x (vec, less, startpos, endpos) Sort the vector @var{vec}, using @var{less} for comparing -the vector elements. @var{startpos} and @var{endpos} delimit +the vector elements. @var{startpos} (inclusively) and +@var{endpos} (exclusively) delimit the range of the vector which gets sorted. The return value is not specified. @end deffn sorted? -@c snarfed from sort.c:321 +@c snarfed from sort.c:111 @deffn {Scheme Procedure} sorted? items less @deffnx {C Function} scm_sorted_p (items, less) Return @code{#t} iff @var{items} is a list or a vector such that @@ -4496,7 +4881,7 @@ applied to all elements i - 1 and i @end deffn merge -@c snarfed from sort.c:393 +@c snarfed from sort.c:186 @deffn {Scheme Procedure} merge alist blist less @deffnx {C Function} scm_merge (alist, blist, less) Merge two already sorted lists into one. @@ -4509,7 +4894,7 @@ Note: this does _not_ accept vectors. @end deffn merge! -@c snarfed from sort.c:508 +@c snarfed from sort.c:303 @deffn {Scheme Procedure} merge! alist blist less @deffnx {C Function} scm_merge_x (alist, blist, less) Takes two lists @var{alist} and @var{blist} such that @@ -4522,7 +4907,7 @@ Note: this does _not_ accept vectors. @end deffn sort! -@c snarfed from sort.c:577 +@c snarfed from sort.c:373 @deffn {Scheme Procedure} sort! items less @deffnx {C Function} scm_sort_x (items, less) Sort the sequence @var{items}, which may be a list or a @@ -4533,7 +4918,7 @@ This is not a stable sort. @end deffn sort -@c snarfed from sort.c:609 +@c snarfed from sort.c:404 @deffn {Scheme Procedure} sort items less @deffnx {C Function} scm_sort (items, less) Sort the sequence @var{items}, which may be a list or a @@ -4542,7 +4927,7 @@ elements. This is not a stable sort. @end deffn stable-sort! -@c snarfed from sort.c:717 +@c snarfed from sort.c:487 @deffn {Scheme Procedure} stable-sort! items less @deffnx {C Function} scm_stable_sort_x (items, less) Sort the sequence @var{items}, which may be a list or a @@ -4553,7 +4938,7 @@ This is a stable sort. @end deffn stable-sort -@c snarfed from sort.c:756 +@c snarfed from sort.c:531 @deffn {Scheme Procedure} stable-sort items less @deffnx {C Function} scm_stable_sort (items, less) Sort the sequence @var{items}, which may be a list or a @@ -4562,7 +4947,7 @@ This is a stable sort. @end deffn sort-list! -@c snarfed from sort.c:797 +@c snarfed from sort.c:549 @deffn {Scheme Procedure} sort-list! items less @deffnx {C Function} scm_sort_list_x (items, less) Sort the list @var{items}, using @var{less} for comparing the @@ -4572,7 +4957,7 @@ This is a stable sort. @end deffn sort-list -@c snarfed from sort.c:812 +@c snarfed from sort.c:564 @deffn {Scheme Procedure} sort-list items less @deffnx {C Function} scm_sort_list (items, less) Sort the list @var{items}, using @var{less} for comparing the @@ -4580,14 +4965,14 @@ list elements. This is a stable sort. @end deffn source-properties -@c snarfed from srcprop.c:152 +@c snarfed from srcprop.c:153 @deffn {Scheme Procedure} source-properties obj @deffnx {C Function} scm_source_properties (obj) Return the source property association list of @var{obj}. @end deffn set-source-properties! -@c snarfed from srcprop.c:175 +@c snarfed from srcprop.c:176 @deffn {Scheme Procedure} set-source-properties! obj plist @deffnx {C Function} scm_set_source_properties_x (obj, plist) Install the association list @var{plist} as the source property @@ -4595,7 +4980,7 @@ list for @var{obj}. @end deffn source-property -@c snarfed from srcprop.c:193 +@c snarfed from srcprop.c:194 @deffn {Scheme Procedure} source-property obj key @deffnx {C Function} scm_source_property (obj, key) Return the source property specified by @var{key} from @@ -4603,7 +4988,7 @@ Return the source property specified by @var{key} from @end deffn set-source-property! -@c snarfed from srcprop.c:224 +@c snarfed from srcprop.c:225 @deffn {Scheme Procedure} set-source-property! obj key datum @deffnx {C Function} scm_set_source_property_x (obj, key, datum) Set the source property of object @var{obj}, which is specified by @@ -4611,14 +4996,14 @@ Set the source property of object @var{obj}, which is specified by @end deffn stack? -@c snarfed from stacks.c:384 +@c snarfed from stacks.c:391 @deffn {Scheme Procedure} stack? obj @deffnx {C Function} scm_stack_p (obj) Return @code{#t} if @var{obj} is a calling stack. @end deffn make-stack -@c snarfed from stacks.c:415 +@c snarfed from stacks.c:422 @deffn {Scheme Procedure} make-stack obj . args @deffnx {C Function} scm_make_stack (obj, args) Create a new stack. If @var{obj} is @code{#t}, the current @@ -4652,35 +5037,35 @@ taken as 0. @end deffn stack-id -@c snarfed from stacks.c:507 +@c snarfed from stacks.c:511 @deffn {Scheme Procedure} stack-id stack @deffnx {C Function} scm_stack_id (stack) Return the identifier given to @var{stack} by @code{start-stack}. @end deffn stack-ref -@c snarfed from stacks.c:548 +@c snarfed from stacks.c:549 @deffn {Scheme Procedure} stack-ref stack index @deffnx {C Function} scm_stack_ref (stack, index) Return the @var{index}'th frame from @var{stack}. @end deffn stack-length -@c snarfed from stacks.c:561 +@c snarfed from stacks.c:562 @deffn {Scheme Procedure} stack-length stack @deffnx {C Function} scm_stack_length (stack) Return the length of @var{stack}. @end deffn frame? -@c snarfed from stacks.c:574 +@c snarfed from stacks.c:575 @deffn {Scheme Procedure} frame? obj @deffnx {C Function} scm_frame_p (obj) Return @code{#t} if @var{obj} is a stack frame. @end deffn last-stack-frame -@c snarfed from stacks.c:585 +@c snarfed from stacks.c:586 @deffn {Scheme Procedure} last-stack-frame obj @deffnx {C Function} scm_last_stack_frame (obj) Return a stack which consists of a single frame, which is the @@ -4689,21 +5074,21 @@ debug object or a continuation. @end deffn frame-number -@c snarfed from stacks.c:627 +@c snarfed from stacks.c:625 @deffn {Scheme Procedure} frame-number frame @deffnx {C Function} scm_frame_number (frame) Return the frame number of @var{frame}. @end deffn frame-source -@c snarfed from stacks.c:637 +@c snarfed from stacks.c:635 @deffn {Scheme Procedure} frame-source frame @deffnx {C Function} scm_frame_source (frame) Return the source of @var{frame}. @end deffn frame-procedure -@c snarfed from stacks.c:648 +@c snarfed from stacks.c:646 @deffn {Scheme Procedure} frame-procedure frame @deffnx {C Function} scm_frame_procedure (frame) Return the procedure for @var{frame}, or @code{#f} if no @@ -4711,14 +5096,14 @@ procedure is associated with @var{frame}. @end deffn frame-arguments -@c snarfed from stacks.c:660 +@c snarfed from stacks.c:658 @deffn {Scheme Procedure} frame-arguments frame @deffnx {C Function} scm_frame_arguments (frame) Return the arguments of @var{frame}. @end deffn frame-previous -@c snarfed from stacks.c:671 +@c snarfed from stacks.c:669 @deffn {Scheme Procedure} frame-previous frame @deffnx {C Function} scm_frame_previous (frame) Return the previous frame of @var{frame}, or @code{#f} if @@ -4726,7 +5111,7 @@ Return the previous frame of @var{frame}, or @code{#f} if @end deffn frame-next -@c snarfed from stacks.c:687 +@c snarfed from stacks.c:685 @deffn {Scheme Procedure} frame-next frame @deffnx {C Function} scm_frame_next (frame) Return the next frame of @var{frame}, or @code{#f} if @@ -4734,35 +5119,35 @@ Return the next frame of @var{frame}, or @code{#f} if @end deffn frame-real? -@c snarfed from stacks.c:702 +@c snarfed from stacks.c:700 @deffn {Scheme Procedure} frame-real? frame @deffnx {C Function} scm_frame_real_p (frame) Return @code{#t} if @var{frame} is a real frame. @end deffn frame-procedure? -@c snarfed from stacks.c:712 +@c snarfed from stacks.c:710 @deffn {Scheme Procedure} frame-procedure? frame @deffnx {C Function} scm_frame_procedure_p (frame) Return @code{#t} if a procedure is associated with @var{frame}. @end deffn frame-evaluating-args? -@c snarfed from stacks.c:722 +@c snarfed from stacks.c:720 @deffn {Scheme Procedure} frame-evaluating-args? frame @deffnx {C Function} scm_frame_evaluating_args_p (frame) Return @code{#t} if @var{frame} contains evaluated arguments. @end deffn frame-overflow? -@c snarfed from stacks.c:732 +@c snarfed from stacks.c:730 @deffn {Scheme Procedure} frame-overflow? frame @deffnx {C Function} scm_frame_overflow_p (frame) Return @code{#t} if @var{frame} is an overflow frame. @end deffn get-internal-real-time -@c snarfed from stime.c:117 +@c snarfed from stime.c:133 @deffn {Scheme Procedure} get-internal-real-time @deffnx {C Function} scm_get_internal_real_time () Return the number of time units since the interpreter was @@ -4770,7 +5155,7 @@ started. @end deffn times -@c snarfed from stime.c:164 +@c snarfed from stime.c:180 @deffn {Scheme Procedure} times @deffnx {C Function} scm_times () Return an object with information about real and processor @@ -4797,7 +5182,7 @@ terminated child processes. @end deffn get-internal-run-time -@c snarfed from stime.c:196 +@c snarfed from stime.c:212 @deffn {Scheme Procedure} get-internal-run-time @deffnx {C Function} scm_get_internal_run_time () Return the number of time units of processor time used by the @@ -4806,7 +5191,7 @@ included but subprocesses are not. @end deffn current-time -@c snarfed from stime.c:213 +@c snarfed from stime.c:229 @deffn {Scheme Procedure} current-time @deffnx {C Function} scm_current_time () Return the number of seconds since 1970-01-01 00:00:00 UTC, @@ -4814,7 +5199,7 @@ excluding leap seconds. @end deffn gettimeofday -@c snarfed from stime.c:231 +@c snarfed from stime.c:248 @deffn {Scheme Procedure} gettimeofday @deffnx {C Function} scm_gettimeofday () Return a pair containing the number of seconds and microseconds @@ -4824,7 +5209,7 @@ operating system. @end deffn localtime -@c snarfed from stime.c:335 +@c snarfed from stime.c:364 @deffn {Scheme Procedure} localtime time [zone] @deffnx {C Function} scm_localtime (time, zone) Return an object representing the broken down components of @@ -4835,7 +5220,7 @@ optionally specified by @var{zone} (a string), otherwise the @end deffn gmtime -@c snarfed from stime.c:420 +@c snarfed from stime.c:449 @deffn {Scheme Procedure} gmtime time @deffnx {C Function} scm_gmtime (time) Return an object representing the broken down components of @@ -4844,7 +5229,7 @@ Return an object representing the broken down components of @end deffn mktime -@c snarfed from stime.c:498 +@c snarfed from stime.c:517 @deffn {Scheme Procedure} mktime sbd_time [zone] @deffnx {C Function} scm_mktime (sbd_time, zone) @var{bd-time} is an object representing broken down time and @code{zone} @@ -4858,7 +5243,7 @@ as @var{bd-time} but with normalized values. @end deffn tzset -@c snarfed from stime.c:581 +@c snarfed from stime.c:603 @deffn {Scheme Procedure} tzset @deffnx {C Function} scm_tzset () Initialize the timezone from the TZ environment variable @@ -4868,7 +5253,7 @@ timezone. @end deffn strftime -@c snarfed from stime.c:598 +@c snarfed from stime.c:620 @deffn {Scheme Procedure} strftime format stime @deffnx {C Function} scm_strftime (format, stime) Formats a time specification @var{time} using @var{template}. @var{time} @@ -4881,7 +5266,7 @@ is the formatted string. @end deffn strptime -@c snarfed from stime.c:696 +@c snarfed from stime.c:721 @deffn {Scheme Procedure} strptime format string @deffnx {C Function} scm_strptime (format, string) Performs the reverse action to @code{strftime}, parsing @@ -4897,20 +5282,20 @@ which were used for the conversion. @end deffn string? -@c snarfed from strings.c:494 +@c snarfed from strings.c:526 @deffn {Scheme Procedure} string? obj @deffnx {C Function} scm_string_p (obj) Return @code{#t} if @var{obj} is a string, else @code{#f}. @end deffn list->string -@c snarfed from strings.c:502 +@c snarfed from strings.c:534 @deffn {Scheme Procedure} list->string implemented by the C function "scm_string" @end deffn string -@c snarfed from strings.c:508 +@c snarfed from strings.c:540 @deffn {Scheme Procedure} string . chrs @deffnx {Scheme Procedure} list->string chrs @deffnx {C Function} scm_string (chrs) @@ -4919,7 +5304,7 @@ Return a newly allocated string composed of the arguments, @end deffn make-string -@c snarfed from strings.c:546 +@c snarfed from strings.c:578 @deffn {Scheme Procedure} make-string k [chr] @deffnx {C Function} scm_make_string (k, chr) Return a newly allocated string of @@ -4929,14 +5314,14 @@ of the @var{string} are unspecified. @end deffn string-length -@c snarfed from strings.c:572 +@c snarfed from strings.c:604 @deffn {Scheme Procedure} string-length string @deffnx {C Function} scm_string_length (string) Return the number of characters in @var{string}. @end deffn string-ref -@c snarfed from strings.c:591 +@c snarfed from strings.c:623 @deffn {Scheme Procedure} string-ref str k @deffnx {C Function} scm_string_ref (str, k) Return character @var{k} of @var{str} using zero-origin @@ -4944,7 +5329,7 @@ indexing. @var{k} must be a valid index of @var{str}. @end deffn string-set! -@c snarfed from strings.c:614 +@c snarfed from strings.c:646 @deffn {Scheme Procedure} string-set! str k chr @deffnx {C Function} scm_string_set_x (str, k, chr) Store @var{chr} in element @var{k} of @var{str} and return @@ -4953,7 +5338,7 @@ an unspecified value. @var{k} must be a valid index of @end deffn substring -@c snarfed from strings.c:650 +@c snarfed from strings.c:682 @deffn {Scheme Procedure} substring str start [end] @deffnx {C Function} scm_substring (str, start, end) Return a newly allocated string formed from the characters @@ -4965,8 +5350,24 @@ exact integers satisfying: 0 <= @var{start} <= @var{end} <= (string-length @var{str}). @end deffn + substring/read-only +@c snarfed from strings.c:708 +@deffn {Scheme Procedure} substring/read-only str start [end] +@deffnx {C Function} scm_substring_read_only (str, start, end) +Return a newly allocated string formed from the characters +of @var{str} beginning with index @var{start} (inclusive) and +ending with index @var{end} (exclusive). +@var{str} must be a string, @var{start} and @var{end} must be +exact integers satisfying: + +0 <= @var{start} <= @var{end} <= (string-length @var{str}). + +The returned string is read-only. + +@end deffn + substring/copy -@c snarfed from strings.c:673 +@c snarfed from strings.c:731 @deffn {Scheme Procedure} substring/copy str start [end] @deffnx {C Function} scm_substring_copy (str, start, end) Return a newly allocated string formed from the characters @@ -4979,7 +5380,7 @@ exact integers satisfying: @end deffn substring/shared -@c snarfed from strings.c:697 +@c snarfed from strings.c:755 @deffn {Scheme Procedure} substring/shared str start [end] @deffnx {C Function} scm_substring_shared (str, start, end) Return string that indirectly refers to the characters @@ -4992,104 +5393,1083 @@ exact integers satisfying: @end deffn string-append -@c snarfed from strings.c:716 +@c snarfed from strings.c:774 @deffn {Scheme Procedure} string-append . args @deffnx {C Function} scm_string_append (args) Return a newly allocated string whose characters form the concatenation of the given strings, @var{args}. @end deffn - string-null? -@c snarfed from srfi-13.c:71 -@deffn {Scheme Procedure} string-null? str -@deffnx {C Function} scm_string_null_p (str) -Return @code{#t} if @var{str}'s length is zero, and -@code{#f} otherwise. -@lisp -(string-null? "") @result{} #t -y @result{} "foo" -(string-null? y) @result{} #f -@end lisp + uniform-vector? +@c snarfed from srfi-4.c:651 +@deffn {Scheme Procedure} uniform-vector? obj +@deffnx {C Function} scm_uniform_vector_p (obj) +Return @code{#t} if @var{obj} is a uniform vector. @end deffn - string-any -@c snarfed from srfi-13.c:91 -@deffn {Scheme Procedure} string-any char_pred s [start [end]] -@deffnx {C Function} scm_string_any (char_pred, s, start, end) -Check if the predicate @var{pred} is true for any character in -the string @var{s}. + uniform-vector-ref +@c snarfed from srfi-4.c:677 +@deffn {Scheme Procedure} uniform-vector-ref v idx +@deffnx {C Function} scm_uniform_vector_ref (v, idx) +Return the element at index @var{idx} of the +homogenous numeric vector @var{v}. +@end deffn -Calls to @var{pred} are made from left to right across @var{s}. -When it returns true (ie.@: non-@code{#f}), that return value -is the return from @code{string-any}. + uniform-vector-set! +@c snarfed from srfi-4.c:714 +@deffn {Scheme Procedure} uniform-vector-set! v idx val +@deffnx {C Function} scm_uniform_vector_set_x (v, idx, val) +Set the element at index @var{idx} of the +homogenous numeric vector @var{v} to @var{val}. +@end deffn -The SRFI-13 specification requires that the call to @var{pred} -on the last character of @var{s} (assuming that point is -reached) be a tail call, but currently in Guile this is not the -case. + uniform-vector->list +@c snarfed from srfi-4.c:737 +@deffn {Scheme Procedure} uniform-vector->list uvec +@deffnx {C Function} scm_uniform_vector_to_list (uvec) +Convert the uniform numeric vector @var{uvec} to a list. @end deffn - string-every -@c snarfed from srfi-13.c:150 -@deffn {Scheme Procedure} string-every char_pred s [start [end]] -@deffnx {C Function} scm_string_every (char_pred, s, start, end) -Check if the predicate @var{pred} is true for every character -in the string @var{s}. + uniform-vector-length +@c snarfed from srfi-4.c:820 +@deffn {Scheme Procedure} uniform-vector-length v +@deffnx {C Function} scm_uniform_vector_length (v) +Return the number of elements in the uniform vector @var{v}. +@end deffn -Calls to @var{pred} are made from left to right across @var{s}. -If the predicate is true for every character then the return -value from the last @var{pred} call is the return from -@code{string-every}. + uniform-vector-read! +@c snarfed from srfi-4.c:845 +@deffn {Scheme Procedure} uniform-array-read! ura [port_or_fd [start [end]]] +@deffnx {Scheme Procedure} uniform-vector-read! uve [port-or-fdes] [start] [end] +@deffnx {C Function} scm_uniform_array_read_x (ura, port_or_fd, start, end) +Attempt 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, +the objects up to that point are put into @var{ura} +(starting at the beginning) and the remainder of the array is +unchanged. -If there are no characters in @var{s} (ie.@: @var{start} equals -@var{end}) then the return is @code{#t}. +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. -The SRFI-13 specification requires that the call to @var{pred} -on the last character of @var{s} (assuming that point is -reached) be a tail call, but currently in Guile this is not the -case. +@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)}. @end deffn - string-tabulate -@c snarfed from srfi-13.c:202 -@deffn {Scheme Procedure} string-tabulate proc len -@deffnx {C Function} scm_string_tabulate (proc, len) -@var{proc} is an integer->char procedure. Construct a string -of size @var{len} by applying @var{proc} to each index to -produce the corresponding string element. The order in which -@var{proc} is applied to the indices is not specified. + uniform-vector-write +@c snarfed from srfi-4.c:958 +@deffn {Scheme Procedure} uniform-vector-write uvec [port_or_fd [start [end]]] +@deffnx {C Function} scm_uniform_vector_write (uvec, port_or_fd, start, end) +Write the elements of @var{uvec} as raw bytes to +@var{port-or-fdes}, in the host byte order. + +The optional arguments @var{start} (inclusive) +and @var{end} (exclusive) allow +a specified region to be written. + +When @var{port-or-fdes} is a port, all specified elements +of @var{uvec} are attempted to be written, potentially blocking +while waiting for more room. +When @var{port-or-fd} is an integer, a single call to +write(2) is made. + +An error is signalled when the last element has only +been partially written in the single call to write(2). + +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)}. @end deffn - string->list -@c snarfed from srfi-13.c:234 -@deffn {Scheme Procedure} string->list str [start [end]] -@deffnx {C Function} scm_substring_to_list (str, start, end) -Convert the string @var{str} into a list of characters. + u8vector? +@c snarfed from ../libguile/srfi-4.i.c:41 +@deffn {Scheme Procedure} u8vector? obj +@deffnx {C Function} scm_u8vector_p (obj) +Return @code{#t} if @var{obj} is a vector of type u8, +@code{#f} otherwise. @end deffn - reverse-list->string -@c snarfed from srfi-13.c:271 -@deffn {Scheme Procedure} reverse-list->string chrs -@deffnx {C Function} scm_reverse_list_to_string (chrs) -An efficient implementation of @code{(compose string->list -reverse)}: + make-u8vector +@c snarfed from ../libguile/srfi-4.i.c:53 +@deffn {Scheme Procedure} make-u8vector len [fill] +@deffnx {C Function} scm_make_u8vector (len, fill) +Return a newly allocated uniform numeric vector which can +hold @var{len} elements. If @var{fill} is given, it is used to +initialize the elements, otherwise the contents of the vector +is unspecified. +@end deffn -@smalllisp -(reverse-list->string '(#\a #\B #\c)) @result{} "cBa" -@end smalllisp + u8vector +@c snarfed from ../libguile/srfi-4.i.c:63 +@deffn {Scheme Procedure} u8vector . l +@deffnx {C Function} scm_u8vector (l) +Return a newly allocated uniform numeric vector containing +all argument values. @end deffn - string-join -@c snarfed from srfi-13.c:324 -@deffn {Scheme Procedure} string-join ls [delimiter [grammar]] -@deffnx {C Function} scm_string_join (ls, delimiter, grammar) -Append the string in the string list @var{ls}, using the string -@var{delim} as a delimiter between the elements of @var{ls}. -@var{grammar} is a symbol which specifies how the delimiter is -placed between the strings, and defaults to the symbol -@code{infix}. + u8vector-length +@c snarfed from ../libguile/srfi-4.i.c:74 +@deffn {Scheme Procedure} u8vector-length uvec +@deffnx {C Function} scm_u8vector_length (uvec) +Return the number of elements in the uniform numeric vector +@var{uvec}. +@end deffn -@table @code + u8vector-ref +@c snarfed from ../libguile/srfi-4.i.c:85 +@deffn {Scheme Procedure} u8vector-ref uvec index +@deffnx {C Function} scm_u8vector_ref (uvec, index) +Return the element at @var{index} in the uniform numeric +vector @var{uvec}. +@end deffn + + u8vector-set! +@c snarfed from ../libguile/srfi-4.i.c:97 +@deffn {Scheme Procedure} u8vector-set! uvec index value +@deffnx {C Function} scm_u8vector_set_x (uvec, index, value) +Set the element at @var{index} in the uniform numeric +vector @var{uvec} to @var{value}. The return value is not +specified. +@end deffn + + u8vector->list +@c snarfed from ../libguile/srfi-4.i.c:107 +@deffn {Scheme Procedure} u8vector->list uvec +@deffnx {C Function} scm_u8vector_to_list (uvec) +Convert the uniform numeric vector @var{uvec} to a list. +@end deffn + + list->u8vector +@c snarfed from ../libguile/srfi-4.i.c:117 +@deffn {Scheme Procedure} list->u8vector l +@deffnx {C Function} scm_list_to_u8vector (l) +Convert the list @var{l} to a numeric uniform vector. +@end deffn + + any->u8vector +@c snarfed from ../libguile/srfi-4.i.c:128 +@deffn {Scheme Procedure} any->u8vector obj +@deffnx {C Function} scm_any_to_u8vector (obj) +Convert @var{obj}, which can be a list, vector, or +uniform vector, to a numeric uniform vector of +type u8. +@end deffn + + s8vector? +@c snarfed from ../libguile/srfi-4.i.c:41 +@deffn {Scheme Procedure} s8vector? obj +@deffnx {C Function} scm_s8vector_p (obj) +Return @code{#t} if @var{obj} is a vector of type s8, +@code{#f} otherwise. +@end deffn + + make-s8vector +@c snarfed from ../libguile/srfi-4.i.c:53 +@deffn {Scheme Procedure} make-s8vector len [fill] +@deffnx {C Function} scm_make_s8vector (len, fill) +Return a newly allocated uniform numeric vector which can +hold @var{len} elements. If @var{fill} is given, it is used to +initialize the elements, otherwise the contents of the vector +is unspecified. +@end deffn + + s8vector +@c snarfed from ../libguile/srfi-4.i.c:63 +@deffn {Scheme Procedure} s8vector . l +@deffnx {C Function} scm_s8vector (l) +Return a newly allocated uniform numeric vector containing +all argument values. +@end deffn + + s8vector-length +@c snarfed from ../libguile/srfi-4.i.c:74 +@deffn {Scheme Procedure} s8vector-length uvec +@deffnx {C Function} scm_s8vector_length (uvec) +Return the number of elements in the uniform numeric vector +@var{uvec}. +@end deffn + + s8vector-ref +@c snarfed from ../libguile/srfi-4.i.c:85 +@deffn {Scheme Procedure} s8vector-ref uvec index +@deffnx {C Function} scm_s8vector_ref (uvec, index) +Return the element at @var{index} in the uniform numeric +vector @var{uvec}. +@end deffn + + s8vector-set! +@c snarfed from ../libguile/srfi-4.i.c:97 +@deffn {Scheme Procedure} s8vector-set! uvec index value +@deffnx {C Function} scm_s8vector_set_x (uvec, index, value) +Set the element at @var{index} in the uniform numeric +vector @var{uvec} to @var{value}. The return value is not +specified. +@end deffn + + s8vector->list +@c snarfed from ../libguile/srfi-4.i.c:107 +@deffn {Scheme Procedure} s8vector->list uvec +@deffnx {C Function} scm_s8vector_to_list (uvec) +Convert the uniform numeric vector @var{uvec} to a list. +@end deffn + + list->s8vector +@c snarfed from ../libguile/srfi-4.i.c:117 +@deffn {Scheme Procedure} list->s8vector l +@deffnx {C Function} scm_list_to_s8vector (l) +Convert the list @var{l} to a numeric uniform vector. +@end deffn + + any->s8vector +@c snarfed from ../libguile/srfi-4.i.c:128 +@deffn {Scheme Procedure} any->s8vector obj +@deffnx {C Function} scm_any_to_s8vector (obj) +Convert @var{obj}, which can be a list, vector, or +uniform vector, to a numeric uniform vector of +type s8. +@end deffn + + u16vector? +@c snarfed from ../libguile/srfi-4.i.c:41 +@deffn {Scheme Procedure} u16vector? obj +@deffnx {C Function} scm_u16vector_p (obj) +Return @code{#t} if @var{obj} is a vector of type u16, +@code{#f} otherwise. +@end deffn + + make-u16vector +@c snarfed from ../libguile/srfi-4.i.c:53 +@deffn {Scheme Procedure} make-u16vector len [fill] +@deffnx {C Function} scm_make_u16vector (len, fill) +Return a newly allocated uniform numeric vector which can +hold @var{len} elements. If @var{fill} is given, it is used to +initialize the elements, otherwise the contents of the vector +is unspecified. +@end deffn + + u16vector +@c snarfed from ../libguile/srfi-4.i.c:63 +@deffn {Scheme Procedure} u16vector . l +@deffnx {C Function} scm_u16vector (l) +Return a newly allocated uniform numeric vector containing +all argument values. +@end deffn + + u16vector-length +@c snarfed from ../libguile/srfi-4.i.c:74 +@deffn {Scheme Procedure} u16vector-length uvec +@deffnx {C Function} scm_u16vector_length (uvec) +Return the number of elements in the uniform numeric vector +@var{uvec}. +@end deffn + + u16vector-ref +@c snarfed from ../libguile/srfi-4.i.c:85 +@deffn {Scheme Procedure} u16vector-ref uvec index +@deffnx {C Function} scm_u16vector_ref (uvec, index) +Return the element at @var{index} in the uniform numeric +vector @var{uvec}. +@end deffn + + u16vector-set! +@c snarfed from ../libguile/srfi-4.i.c:97 +@deffn {Scheme Procedure} u16vector-set! uvec index value +@deffnx {C Function} scm_u16vector_set_x (uvec, index, value) +Set the element at @var{index} in the uniform numeric +vector @var{uvec} to @var{value}. The return value is not +specified. +@end deffn + + u16vector->list +@c snarfed from ../libguile/srfi-4.i.c:107 +@deffn {Scheme Procedure} u16vector->list uvec +@deffnx {C Function} scm_u16vector_to_list (uvec) +Convert the uniform numeric vector @var{uvec} to a list. +@end deffn + + list->u16vector +@c snarfed from ../libguile/srfi-4.i.c:117 +@deffn {Scheme Procedure} list->u16vector l +@deffnx {C Function} scm_list_to_u16vector (l) +Convert the list @var{l} to a numeric uniform vector. +@end deffn + + any->u16vector +@c snarfed from ../libguile/srfi-4.i.c:128 +@deffn {Scheme Procedure} any->u16vector obj +@deffnx {C Function} scm_any_to_u16vector (obj) +Convert @var{obj}, which can be a list, vector, or +uniform vector, to a numeric uniform vector of +type u16. +@end deffn + + s16vector? +@c snarfed from ../libguile/srfi-4.i.c:41 +@deffn {Scheme Procedure} s16vector? obj +@deffnx {C Function} scm_s16vector_p (obj) +Return @code{#t} if @var{obj} is a vector of type s16, +@code{#f} otherwise. +@end deffn + + make-s16vector +@c snarfed from ../libguile/srfi-4.i.c:53 +@deffn {Scheme Procedure} make-s16vector len [fill] +@deffnx {C Function} scm_make_s16vector (len, fill) +Return a newly allocated uniform numeric vector which can +hold @var{len} elements. If @var{fill} is given, it is used to +initialize the elements, otherwise the contents of the vector +is unspecified. +@end deffn + + s16vector +@c snarfed from ../libguile/srfi-4.i.c:63 +@deffn {Scheme Procedure} s16vector . l +@deffnx {C Function} scm_s16vector (l) +Return a newly allocated uniform numeric vector containing +all argument values. +@end deffn + + s16vector-length +@c snarfed from ../libguile/srfi-4.i.c:74 +@deffn {Scheme Procedure} s16vector-length uvec +@deffnx {C Function} scm_s16vector_length (uvec) +Return the number of elements in the uniform numeric vector +@var{uvec}. +@end deffn + + s16vector-ref +@c snarfed from ../libguile/srfi-4.i.c:85 +@deffn {Scheme Procedure} s16vector-ref uvec index +@deffnx {C Function} scm_s16vector_ref (uvec, index) +Return the element at @var{index} in the uniform numeric +vector @var{uvec}. +@end deffn + + s16vector-set! +@c snarfed from ../libguile/srfi-4.i.c:97 +@deffn {Scheme Procedure} s16vector-set! uvec index value +@deffnx {C Function} scm_s16vector_set_x (uvec, index, value) +Set the element at @var{index} in the uniform numeric +vector @var{uvec} to @var{value}. The return value is not +specified. +@end deffn + + s16vector->list +@c snarfed from ../libguile/srfi-4.i.c:107 +@deffn {Scheme Procedure} s16vector->list uvec +@deffnx {C Function} scm_s16vector_to_list (uvec) +Convert the uniform numeric vector @var{uvec} to a list. +@end deffn + + list->s16vector +@c snarfed from ../libguile/srfi-4.i.c:117 +@deffn {Scheme Procedure} list->s16vector l +@deffnx {C Function} scm_list_to_s16vector (l) +Convert the list @var{l} to a numeric uniform vector. +@end deffn + + any->s16vector +@c snarfed from ../libguile/srfi-4.i.c:128 +@deffn {Scheme Procedure} any->s16vector obj +@deffnx {C Function} scm_any_to_s16vector (obj) +Convert @var{obj}, which can be a list, vector, or +uniform vector, to a numeric uniform vector of +type s16. +@end deffn + + u32vector? +@c snarfed from ../libguile/srfi-4.i.c:41 +@deffn {Scheme Procedure} u32vector? obj +@deffnx {C Function} scm_u32vector_p (obj) +Return @code{#t} if @var{obj} is a vector of type u32, +@code{#f} otherwise. +@end deffn + + make-u32vector +@c snarfed from ../libguile/srfi-4.i.c:53 +@deffn {Scheme Procedure} make-u32vector len [fill] +@deffnx {C Function} scm_make_u32vector (len, fill) +Return a newly allocated uniform numeric vector which can +hold @var{len} elements. If @var{fill} is given, it is used to +initialize the elements, otherwise the contents of the vector +is unspecified. +@end deffn + + u32vector +@c snarfed from ../libguile/srfi-4.i.c:63 +@deffn {Scheme Procedure} u32vector . l +@deffnx {C Function} scm_u32vector (l) +Return a newly allocated uniform numeric vector containing +all argument values. +@end deffn + + u32vector-length +@c snarfed from ../libguile/srfi-4.i.c:74 +@deffn {Scheme Procedure} u32vector-length uvec +@deffnx {C Function} scm_u32vector_length (uvec) +Return the number of elements in the uniform numeric vector +@var{uvec}. +@end deffn + + u32vector-ref +@c snarfed from ../libguile/srfi-4.i.c:85 +@deffn {Scheme Procedure} u32vector-ref uvec index +@deffnx {C Function} scm_u32vector_ref (uvec, index) +Return the element at @var{index} in the uniform numeric +vector @var{uvec}. +@end deffn + + u32vector-set! +@c snarfed from ../libguile/srfi-4.i.c:97 +@deffn {Scheme Procedure} u32vector-set! uvec index value +@deffnx {C Function} scm_u32vector_set_x (uvec, index, value) +Set the element at @var{index} in the uniform numeric +vector @var{uvec} to @var{value}. The return value is not +specified. +@end deffn + + u32vector->list +@c snarfed from ../libguile/srfi-4.i.c:107 +@deffn {Scheme Procedure} u32vector->list uvec +@deffnx {C Function} scm_u32vector_to_list (uvec) +Convert the uniform numeric vector @var{uvec} to a list. +@end deffn + + list->u32vector +@c snarfed from ../libguile/srfi-4.i.c:117 +@deffn {Scheme Procedure} list->u32vector l +@deffnx {C Function} scm_list_to_u32vector (l) +Convert the list @var{l} to a numeric uniform vector. +@end deffn + + any->u32vector +@c snarfed from ../libguile/srfi-4.i.c:128 +@deffn {Scheme Procedure} any->u32vector obj +@deffnx {C Function} scm_any_to_u32vector (obj) +Convert @var{obj}, which can be a list, vector, or +uniform vector, to a numeric uniform vector of +type u32. +@end deffn + + s32vector? +@c snarfed from ../libguile/srfi-4.i.c:41 +@deffn {Scheme Procedure} s32vector? obj +@deffnx {C Function} scm_s32vector_p (obj) +Return @code{#t} if @var{obj} is a vector of type s32, +@code{#f} otherwise. +@end deffn + + make-s32vector +@c snarfed from ../libguile/srfi-4.i.c:53 +@deffn {Scheme Procedure} make-s32vector len [fill] +@deffnx {C Function} scm_make_s32vector (len, fill) +Return a newly allocated uniform numeric vector which can +hold @var{len} elements. If @var{fill} is given, it is used to +initialize the elements, otherwise the contents of the vector +is unspecified. +@end deffn + + s32vector +@c snarfed from ../libguile/srfi-4.i.c:63 +@deffn {Scheme Procedure} s32vector . l +@deffnx {C Function} scm_s32vector (l) +Return a newly allocated uniform numeric vector containing +all argument values. +@end deffn + + s32vector-length +@c snarfed from ../libguile/srfi-4.i.c:74 +@deffn {Scheme Procedure} s32vector-length uvec +@deffnx {C Function} scm_s32vector_length (uvec) +Return the number of elements in the uniform numeric vector +@var{uvec}. +@end deffn + + s32vector-ref +@c snarfed from ../libguile/srfi-4.i.c:85 +@deffn {Scheme Procedure} s32vector-ref uvec index +@deffnx {C Function} scm_s32vector_ref (uvec, index) +Return the element at @var{index} in the uniform numeric +vector @var{uvec}. +@end deffn + + s32vector-set! +@c snarfed from ../libguile/srfi-4.i.c:97 +@deffn {Scheme Procedure} s32vector-set! uvec index value +@deffnx {C Function} scm_s32vector_set_x (uvec, index, value) +Set the element at @var{index} in the uniform numeric +vector @var{uvec} to @var{value}. The return value is not +specified. +@end deffn + + s32vector->list +@c snarfed from ../libguile/srfi-4.i.c:107 +@deffn {Scheme Procedure} s32vector->list uvec +@deffnx {C Function} scm_s32vector_to_list (uvec) +Convert the uniform numeric vector @var{uvec} to a list. +@end deffn + + list->s32vector +@c snarfed from ../libguile/srfi-4.i.c:117 +@deffn {Scheme Procedure} list->s32vector l +@deffnx {C Function} scm_list_to_s32vector (l) +Convert the list @var{l} to a numeric uniform vector. +@end deffn + + any->s32vector +@c snarfed from ../libguile/srfi-4.i.c:128 +@deffn {Scheme Procedure} any->s32vector obj +@deffnx {C Function} scm_any_to_s32vector (obj) +Convert @var{obj}, which can be a list, vector, or +uniform vector, to a numeric uniform vector of +type s32. +@end deffn + + u64vector? +@c snarfed from ../libguile/srfi-4.i.c:41 +@deffn {Scheme Procedure} u64vector? obj +@deffnx {C Function} scm_u64vector_p (obj) +Return @code{#t} if @var{obj} is a vector of type u64, +@code{#f} otherwise. +@end deffn + + make-u64vector +@c snarfed from ../libguile/srfi-4.i.c:53 +@deffn {Scheme Procedure} make-u64vector len [fill] +@deffnx {C Function} scm_make_u64vector (len, fill) +Return a newly allocated uniform numeric vector which can +hold @var{len} elements. If @var{fill} is given, it is used to +initialize the elements, otherwise the contents of the vector +is unspecified. +@end deffn + + u64vector +@c snarfed from ../libguile/srfi-4.i.c:63 +@deffn {Scheme Procedure} u64vector . l +@deffnx {C Function} scm_u64vector (l) +Return a newly allocated uniform numeric vector containing +all argument values. +@end deffn + + u64vector-length +@c snarfed from ../libguile/srfi-4.i.c:74 +@deffn {Scheme Procedure} u64vector-length uvec +@deffnx {C Function} scm_u64vector_length (uvec) +Return the number of elements in the uniform numeric vector +@var{uvec}. +@end deffn + + u64vector-ref +@c snarfed from ../libguile/srfi-4.i.c:85 +@deffn {Scheme Procedure} u64vector-ref uvec index +@deffnx {C Function} scm_u64vector_ref (uvec, index) +Return the element at @var{index} in the uniform numeric +vector @var{uvec}. +@end deffn + + u64vector-set! +@c snarfed from ../libguile/srfi-4.i.c:97 +@deffn {Scheme Procedure} u64vector-set! uvec index value +@deffnx {C Function} scm_u64vector_set_x (uvec, index, value) +Set the element at @var{index} in the uniform numeric +vector @var{uvec} to @var{value}. The return value is not +specified. +@end deffn + + u64vector->list +@c snarfed from ../libguile/srfi-4.i.c:107 +@deffn {Scheme Procedure} u64vector->list uvec +@deffnx {C Function} scm_u64vector_to_list (uvec) +Convert the uniform numeric vector @var{uvec} to a list. +@end deffn + + list->u64vector +@c snarfed from ../libguile/srfi-4.i.c:117 +@deffn {Scheme Procedure} list->u64vector l +@deffnx {C Function} scm_list_to_u64vector (l) +Convert the list @var{l} to a numeric uniform vector. +@end deffn + + any->u64vector +@c snarfed from ../libguile/srfi-4.i.c:128 +@deffn {Scheme Procedure} any->u64vector obj +@deffnx {C Function} scm_any_to_u64vector (obj) +Convert @var{obj}, which can be a list, vector, or +uniform vector, to a numeric uniform vector of +type u64. +@end deffn + + s64vector? +@c snarfed from ../libguile/srfi-4.i.c:41 +@deffn {Scheme Procedure} s64vector? obj +@deffnx {C Function} scm_s64vector_p (obj) +Return @code{#t} if @var{obj} is a vector of type s64, +@code{#f} otherwise. +@end deffn + + make-s64vector +@c snarfed from ../libguile/srfi-4.i.c:53 +@deffn {Scheme Procedure} make-s64vector len [fill] +@deffnx {C Function} scm_make_s64vector (len, fill) +Return a newly allocated uniform numeric vector which can +hold @var{len} elements. If @var{fill} is given, it is used to +initialize the elements, otherwise the contents of the vector +is unspecified. +@end deffn + + s64vector +@c snarfed from ../libguile/srfi-4.i.c:63 +@deffn {Scheme Procedure} s64vector . l +@deffnx {C Function} scm_s64vector (l) +Return a newly allocated uniform numeric vector containing +all argument values. +@end deffn + + s64vector-length +@c snarfed from ../libguile/srfi-4.i.c:74 +@deffn {Scheme Procedure} s64vector-length uvec +@deffnx {C Function} scm_s64vector_length (uvec) +Return the number of elements in the uniform numeric vector +@var{uvec}. +@end deffn + + s64vector-ref +@c snarfed from ../libguile/srfi-4.i.c:85 +@deffn {Scheme Procedure} s64vector-ref uvec index +@deffnx {C Function} scm_s64vector_ref (uvec, index) +Return the element at @var{index} in the uniform numeric +vector @var{uvec}. +@end deffn + + s64vector-set! +@c snarfed from ../libguile/srfi-4.i.c:97 +@deffn {Scheme Procedure} s64vector-set! uvec index value +@deffnx {C Function} scm_s64vector_set_x (uvec, index, value) +Set the element at @var{index} in the uniform numeric +vector @var{uvec} to @var{value}. The return value is not +specified. +@end deffn + + s64vector->list +@c snarfed from ../libguile/srfi-4.i.c:107 +@deffn {Scheme Procedure} s64vector->list uvec +@deffnx {C Function} scm_s64vector_to_list (uvec) +Convert the uniform numeric vector @var{uvec} to a list. +@end deffn + + list->s64vector +@c snarfed from ../libguile/srfi-4.i.c:117 +@deffn {Scheme Procedure} list->s64vector l +@deffnx {C Function} scm_list_to_s64vector (l) +Convert the list @var{l} to a numeric uniform vector. +@end deffn + + any->s64vector +@c snarfed from ../libguile/srfi-4.i.c:128 +@deffn {Scheme Procedure} any->s64vector obj +@deffnx {C Function} scm_any_to_s64vector (obj) +Convert @var{obj}, which can be a list, vector, or +uniform vector, to a numeric uniform vector of +type s64. +@end deffn + + f32vector? +@c snarfed from ../libguile/srfi-4.i.c:41 +@deffn {Scheme Procedure} f32vector? obj +@deffnx {C Function} scm_f32vector_p (obj) +Return @code{#t} if @var{obj} is a vector of type f32, +@code{#f} otherwise. +@end deffn + + make-f32vector +@c snarfed from ../libguile/srfi-4.i.c:53 +@deffn {Scheme Procedure} make-f32vector len [fill] +@deffnx {C Function} scm_make_f32vector (len, fill) +Return a newly allocated uniform numeric vector which can +hold @var{len} elements. If @var{fill} is given, it is used to +initialize the elements, otherwise the contents of the vector +is unspecified. +@end deffn + + f32vector +@c snarfed from ../libguile/srfi-4.i.c:63 +@deffn {Scheme Procedure} f32vector . l +@deffnx {C Function} scm_f32vector (l) +Return a newly allocated uniform numeric vector containing +all argument values. +@end deffn + + f32vector-length +@c snarfed from ../libguile/srfi-4.i.c:74 +@deffn {Scheme Procedure} f32vector-length uvec +@deffnx {C Function} scm_f32vector_length (uvec) +Return the number of elements in the uniform numeric vector +@var{uvec}. +@end deffn + + f32vector-ref +@c snarfed from ../libguile/srfi-4.i.c:85 +@deffn {Scheme Procedure} f32vector-ref uvec index +@deffnx {C Function} scm_f32vector_ref (uvec, index) +Return the element at @var{index} in the uniform numeric +vector @var{uvec}. +@end deffn + + f32vector-set! +@c snarfed from ../libguile/srfi-4.i.c:97 +@deffn {Scheme Procedure} f32vector-set! uvec index value +@deffnx {C Function} scm_f32vector_set_x (uvec, index, value) +Set the element at @var{index} in the uniform numeric +vector @var{uvec} to @var{value}. The return value is not +specified. +@end deffn + + f32vector->list +@c snarfed from ../libguile/srfi-4.i.c:107 +@deffn {Scheme Procedure} f32vector->list uvec +@deffnx {C Function} scm_f32vector_to_list (uvec) +Convert the uniform numeric vector @var{uvec} to a list. +@end deffn + + list->f32vector +@c snarfed from ../libguile/srfi-4.i.c:117 +@deffn {Scheme Procedure} list->f32vector l +@deffnx {C Function} scm_list_to_f32vector (l) +Convert the list @var{l} to a numeric uniform vector. +@end deffn + + any->f32vector +@c snarfed from ../libguile/srfi-4.i.c:128 +@deffn {Scheme Procedure} any->f32vector obj +@deffnx {C Function} scm_any_to_f32vector (obj) +Convert @var{obj}, which can be a list, vector, or +uniform vector, to a numeric uniform vector of +type f32. +@end deffn + + f64vector? +@c snarfed from ../libguile/srfi-4.i.c:41 +@deffn {Scheme Procedure} f64vector? obj +@deffnx {C Function} scm_f64vector_p (obj) +Return @code{#t} if @var{obj} is a vector of type f64, +@code{#f} otherwise. +@end deffn + + make-f64vector +@c snarfed from ../libguile/srfi-4.i.c:53 +@deffn {Scheme Procedure} make-f64vector len [fill] +@deffnx {C Function} scm_make_f64vector (len, fill) +Return a newly allocated uniform numeric vector which can +hold @var{len} elements. If @var{fill} is given, it is used to +initialize the elements, otherwise the contents of the vector +is unspecified. +@end deffn + + f64vector +@c snarfed from ../libguile/srfi-4.i.c:63 +@deffn {Scheme Procedure} f64vector . l +@deffnx {C Function} scm_f64vector (l) +Return a newly allocated uniform numeric vector containing +all argument values. +@end deffn + + f64vector-length +@c snarfed from ../libguile/srfi-4.i.c:74 +@deffn {Scheme Procedure} f64vector-length uvec +@deffnx {C Function} scm_f64vector_length (uvec) +Return the number of elements in the uniform numeric vector +@var{uvec}. +@end deffn + + f64vector-ref +@c snarfed from ../libguile/srfi-4.i.c:85 +@deffn {Scheme Procedure} f64vector-ref uvec index +@deffnx {C Function} scm_f64vector_ref (uvec, index) +Return the element at @var{index} in the uniform numeric +vector @var{uvec}. +@end deffn + + f64vector-set! +@c snarfed from ../libguile/srfi-4.i.c:97 +@deffn {Scheme Procedure} f64vector-set! uvec index value +@deffnx {C Function} scm_f64vector_set_x (uvec, index, value) +Set the element at @var{index} in the uniform numeric +vector @var{uvec} to @var{value}. The return value is not +specified. +@end deffn + + f64vector->list +@c snarfed from ../libguile/srfi-4.i.c:107 +@deffn {Scheme Procedure} f64vector->list uvec +@deffnx {C Function} scm_f64vector_to_list (uvec) +Convert the uniform numeric vector @var{uvec} to a list. +@end deffn + + list->f64vector +@c snarfed from ../libguile/srfi-4.i.c:117 +@deffn {Scheme Procedure} list->f64vector l +@deffnx {C Function} scm_list_to_f64vector (l) +Convert the list @var{l} to a numeric uniform vector. +@end deffn + + any->f64vector +@c snarfed from ../libguile/srfi-4.i.c:128 +@deffn {Scheme Procedure} any->f64vector obj +@deffnx {C Function} scm_any_to_f64vector (obj) +Convert @var{obj}, which can be a list, vector, or +uniform vector, to a numeric uniform vector of +type f64. +@end deffn + + c32vector? +@c snarfed from ../libguile/srfi-4.i.c:41 +@deffn {Scheme Procedure} c32vector? obj +@deffnx {C Function} scm_c32vector_p (obj) +Return @code{#t} if @var{obj} is a vector of type c32, +@code{#f} otherwise. +@end deffn + + make-c32vector +@c snarfed from ../libguile/srfi-4.i.c:53 +@deffn {Scheme Procedure} make-c32vector len [fill] +@deffnx {C Function} scm_make_c32vector (len, fill) +Return a newly allocated uniform numeric vector which can +hold @var{len} elements. If @var{fill} is given, it is used to +initialize the elements, otherwise the contents of the vector +is unspecified. +@end deffn + + c32vector +@c snarfed from ../libguile/srfi-4.i.c:63 +@deffn {Scheme Procedure} c32vector . l +@deffnx {C Function} scm_c32vector (l) +Return a newly allocated uniform numeric vector containing +all argument values. +@end deffn + + c32vector-length +@c snarfed from ../libguile/srfi-4.i.c:74 +@deffn {Scheme Procedure} c32vector-length uvec +@deffnx {C Function} scm_c32vector_length (uvec) +Return the number of elements in the uniform numeric vector +@var{uvec}. +@end deffn + + c32vector-ref +@c snarfed from ../libguile/srfi-4.i.c:85 +@deffn {Scheme Procedure} c32vector-ref uvec index +@deffnx {C Function} scm_c32vector_ref (uvec, index) +Return the element at @var{index} in the uniform numeric +vector @var{uvec}. +@end deffn + + c32vector-set! +@c snarfed from ../libguile/srfi-4.i.c:97 +@deffn {Scheme Procedure} c32vector-set! uvec index value +@deffnx {C Function} scm_c32vector_set_x (uvec, index, value) +Set the element at @var{index} in the uniform numeric +vector @var{uvec} to @var{value}. The return value is not +specified. +@end deffn + + c32vector->list +@c snarfed from ../libguile/srfi-4.i.c:107 +@deffn {Scheme Procedure} c32vector->list uvec +@deffnx {C Function} scm_c32vector_to_list (uvec) +Convert the uniform numeric vector @var{uvec} to a list. +@end deffn + + list->c32vector +@c snarfed from ../libguile/srfi-4.i.c:117 +@deffn {Scheme Procedure} list->c32vector l +@deffnx {C Function} scm_list_to_c32vector (l) +Convert the list @var{l} to a numeric uniform vector. +@end deffn + + any->c32vector +@c snarfed from ../libguile/srfi-4.i.c:128 +@deffn {Scheme Procedure} any->c32vector obj +@deffnx {C Function} scm_any_to_c32vector (obj) +Convert @var{obj}, which can be a list, vector, or +uniform vector, to a numeric uniform vector of +type c32. +@end deffn + + c64vector? +@c snarfed from ../libguile/srfi-4.i.c:41 +@deffn {Scheme Procedure} c64vector? obj +@deffnx {C Function} scm_c64vector_p (obj) +Return @code{#t} if @var{obj} is a vector of type c64, +@code{#f} otherwise. +@end deffn + + make-c64vector +@c snarfed from ../libguile/srfi-4.i.c:53 +@deffn {Scheme Procedure} make-c64vector len [fill] +@deffnx {C Function} scm_make_c64vector (len, fill) +Return a newly allocated uniform numeric vector which can +hold @var{len} elements. If @var{fill} is given, it is used to +initialize the elements, otherwise the contents of the vector +is unspecified. +@end deffn + + c64vector +@c snarfed from ../libguile/srfi-4.i.c:63 +@deffn {Scheme Procedure} c64vector . l +@deffnx {C Function} scm_c64vector (l) +Return a newly allocated uniform numeric vector containing +all argument values. +@end deffn + + c64vector-length +@c snarfed from ../libguile/srfi-4.i.c:74 +@deffn {Scheme Procedure} c64vector-length uvec +@deffnx {C Function} scm_c64vector_length (uvec) +Return the number of elements in the uniform numeric vector +@var{uvec}. +@end deffn + + c64vector-ref +@c snarfed from ../libguile/srfi-4.i.c:85 +@deffn {Scheme Procedure} c64vector-ref uvec index +@deffnx {C Function} scm_c64vector_ref (uvec, index) +Return the element at @var{index} in the uniform numeric +vector @var{uvec}. +@end deffn + + c64vector-set! +@c snarfed from ../libguile/srfi-4.i.c:97 +@deffn {Scheme Procedure} c64vector-set! uvec index value +@deffnx {C Function} scm_c64vector_set_x (uvec, index, value) +Set the element at @var{index} in the uniform numeric +vector @var{uvec} to @var{value}. The return value is not +specified. +@end deffn + + c64vector->list +@c snarfed from ../libguile/srfi-4.i.c:107 +@deffn {Scheme Procedure} c64vector->list uvec +@deffnx {C Function} scm_c64vector_to_list (uvec) +Convert the uniform numeric vector @var{uvec} to a list. +@end deffn + + list->c64vector +@c snarfed from ../libguile/srfi-4.i.c:117 +@deffn {Scheme Procedure} list->c64vector l +@deffnx {C Function} scm_list_to_c64vector (l) +Convert the list @var{l} to a numeric uniform vector. +@end deffn + + any->c64vector +@c snarfed from ../libguile/srfi-4.i.c:128 +@deffn {Scheme Procedure} any->c64vector obj +@deffnx {C Function} scm_any_to_c64vector (obj) +Convert @var{obj}, which can be a list, vector, or +uniform vector, to a numeric uniform vector of +type c64. +@end deffn + + string-null? +@c snarfed from srfi-13.c:62 +@deffn {Scheme Procedure} string-null? str +@deffnx {C Function} scm_string_null_p (str) +Return @code{#t} if @var{str}'s length is zero, and +@code{#f} otherwise. +@lisp +(string-null? "") @result{} #t +y @result{} "foo" +(string-null? y) @result{} #f +@end lisp +@end deffn + + string-any-c-code +@c snarfed from srfi-13.c:94 +@deffn {Scheme Procedure} string-any-c-code char_pred s [start [end]] +@deffnx {C Function} scm_string_any (char_pred, s, start, end) +Check if @var{char_pred} is true for any character in string @var{s}. + +@var{char_pred} can be a character to check for any equal to that, or +a character set (@pxref{Character Sets}) to check for any in that set, +or a predicate procedure to call. + +For a procedure, calls @code{(@var{char_pred} c)} are made +successively on the characters from @var{start} to @var{end}. If +@var{char_pred} returns true (ie.@: non-@code{#f}), @code{string-any} +stops and that return value is the return from @code{string-any}. The +call on the last character (ie.@: at @math{@var{end}-1}), if that +point is reached, is a tail call. + +If there are no characters in @var{s} (ie.@: @var{start} equals +@var{end}) then the return is @code{#f}. + +@end deffn + + string-every-c-code +@c snarfed from srfi-13.c:158 +@deffn {Scheme Procedure} string-every-c-code char_pred s [start [end]] +@deffnx {C Function} scm_string_every (char_pred, s, start, end) +Check if @var{char_pred} is true for every character in string +@var{s}. + +@var{char_pred} can be a character to check for every character equal +to that, or a character set (@pxref{Character Sets}) to check for +every character being in that set, or a predicate procedure to call. + +For a procedure, calls @code{(@var{char_pred} c)} are made +successively on the characters from @var{start} to @var{end}. If +@var{char_pred} returns @code{#f}, @code{string-every} stops and +returns @code{#f}. The call on the last character (ie.@: at +@math{@var{end}-1}), if that point is reached, is a tail call and the +return from that call is the return from @code{string-every}. + +If there are no characters in @var{s} (ie.@: @var{start} equals +@var{end}) then the return is @code{#t}. + +@end deffn + + string-tabulate +@c snarfed from srfi-13.c:214 +@deffn {Scheme Procedure} string-tabulate proc len +@deffnx {C Function} scm_string_tabulate (proc, len) +@var{proc} is an integer->char procedure. Construct a string +of size @var{len} by applying @var{proc} to each index to +produce the corresponding string element. The order in which +@var{proc} is applied to the indices is not specified. +@end deffn + + string->list +@c snarfed from srfi-13.c:246 +@deffn {Scheme Procedure} string->list str [start [end]] +@deffnx {C Function} scm_substring_to_list (str, start, end) +Convert the string @var{str} into a list of characters. +@end deffn + + reverse-list->string +@c snarfed from srfi-13.c:285 +@deffn {Scheme Procedure} reverse-list->string chrs +@deffnx {C Function} scm_reverse_list_to_string (chrs) +An efficient implementation of @code{(compose string->list +reverse)}: + +@smalllisp +(reverse-list->string '(#\a #\B #\c)) @result{} "cBa" +@end smalllisp +@end deffn + + string-join +@c snarfed from srfi-13.c:352 +@deffn {Scheme Procedure} string-join ls [delimiter [grammar]] +@deffnx {C Function} scm_string_join (ls, delimiter, grammar) +Append the string in the string list @var{ls}, using the string +@var{delim} as a delimiter between the elements of @var{ls}. +@var{grammar} is a symbol which specifies how the delimiter is +placed between the strings, and defaults to the symbol +@code{infix}. + +@table @code @item infix Insert the separator between list elements. An empty string will produce an empty list. @@ -5104,7 +6484,7 @@ Insert the separator before each list element. @end deffn string-copy -@c snarfed from srfi-13.c:480 +@c snarfed from srfi-13.c:486 @deffn {Scheme Procedure} string-copy str [start [end]] @deffnx {C Function} scm_srfi13_substring_copy (str, start, end) Return a freshly allocated copy of the string @var{str}. If @@ -5113,7 +6493,7 @@ given, @var{start} and @var{end} delimit the portion of @end deffn string-copy! -@c snarfed from srfi-13.c:507 +@c snarfed from srfi-13.c:513 @deffn {Scheme Procedure} string-copy! target tstart s [start [end]] @deffnx {C Function} scm_string_copy_x (target, tstart, s, start, end) Copy the sequence of characters from index range [@var{start}, @@ -5126,7 +6506,7 @@ string. @end deffn substring-move! -@c snarfed from srfi-13.c:536 +@c snarfed from srfi-13.c:543 @deffn {Scheme Procedure} substring-move! str1 start1 end1 str2 start2 @deffnx {C Function} scm_substring_move_x (str1, start1, end1, str2, start2) Copy the substring of @var{str1} bounded by @var{start1} and @var{end1} @@ -5135,35 +6515,35 @@ into @var{str2} beginning at position @var{start2}. @end deffn string-take -@c snarfed from srfi-13.c:545 +@c snarfed from srfi-13.c:552 @deffn {Scheme Procedure} string-take s n @deffnx {C Function} scm_string_take (s, n) Return the @var{n} first characters of @var{s}. @end deffn string-drop -@c snarfed from srfi-13.c:555 +@c snarfed from srfi-13.c:562 @deffn {Scheme Procedure} string-drop s n @deffnx {C Function} scm_string_drop (s, n) Return all but the first @var{n} characters of @var{s}. @end deffn string-take-right -@c snarfed from srfi-13.c:565 +@c snarfed from srfi-13.c:572 @deffn {Scheme Procedure} string-take-right s n @deffnx {C Function} scm_string_take_right (s, n) Return the @var{n} last characters of @var{s}. @end deffn string-drop-right -@c snarfed from srfi-13.c:577 +@c snarfed from srfi-13.c:584 @deffn {Scheme Procedure} string-drop-right s n @deffnx {C Function} scm_string_drop_right (s, n) Return all but the last @var{n} characters of @var{s}. @end deffn string-pad -@c snarfed from srfi-13.c:592 +@c snarfed from srfi-13.c:599 @deffn {Scheme Procedure} string-pad s len [chr [start [end]]] @deffnx {C Function} scm_string_pad (s, len, chr, start, end) Take that characters from @var{start} to @var{end} from the @@ -5173,7 +6553,7 @@ string is longer than @var{len}, it is truncated on the right. @end deffn string-pad-right -@c snarfed from srfi-13.c:632 +@c snarfed from srfi-13.c:639 @deffn {Scheme Procedure} string-pad-right s len [chr [start [end]]] @deffnx {C Function} scm_string_pad_right (s, len, chr, start, end) Take that characters from @var{start} to @var{end} from the @@ -5183,7 +6563,7 @@ string is longer than @var{len}, it is truncated on the left. @end deffn string-trim -@c snarfed from srfi-13.c:686 +@c snarfed from srfi-13.c:692 @deffn {Scheme Procedure} string-trim s [char_pred [start [end]]] @deffnx {C Function} scm_string_trim (s, char_pred, start, end) Trim @var{s} by skipping over all characters on the left @@ -5207,7 +6587,7 @@ trimmed. @end deffn string-trim-right -@c snarfed from srfi-13.c:762 +@c snarfed from srfi-13.c:768 @deffn {Scheme Procedure} string-trim-right s [char_pred [start [end]]] @deffnx {C Function} scm_string_trim_right (s, char_pred, start, end) Trim @var{s} by skipping over all characters on the rightt @@ -5232,7 +6612,7 @@ trimmed. @end deffn string-trim-both -@c snarfed from srfi-13.c:838 +@c snarfed from srfi-13.c:844 @deffn {Scheme Procedure} string-trim-both s [char_pred [start [end]]] @deffnx {C Function} scm_string_trim_both (s, char_pred, start, end) Trim @var{s} by skipping over all characters on both sides of @@ -5257,7 +6637,7 @@ trimmed. @end deffn string-fill! -@c snarfed from srfi-13.c:925 +@c snarfed from srfi-13.c:931 @deffn {Scheme Procedure} string-fill! str chr [start [end]] @deffnx {C Function} scm_substring_fill_x (str, chr, start, end) Stores @var{chr} in every element of the given @var{str} and @@ -5265,7 +6645,7 @@ returns an unspecified value. @end deffn string-compare -@c snarfed from srfi-13.c:975 +@c snarfed from srfi-13.c:983 @deffn {Scheme Procedure} string-compare s1 s2 proc_lt proc_eq proc_gt [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_compare (s1, s2, proc_lt, proc_eq, proc_gt, start1, end1, start2, end2) Apply @var{proc_lt}, @var{proc_eq}, @var{proc_gt} to the @@ -5277,7 +6657,7 @@ largest index @var{i} such that for every 0 <= @var{j} < @end deffn string-compare-ci -@c snarfed from srfi-13.c:1018 +@c snarfed from srfi-13.c:1037 @deffn {Scheme Procedure} string-compare-ci s1 s2 proc_lt proc_eq proc_gt [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_compare_ci (s1, s2, proc_lt, proc_eq, proc_gt, start1, end1, start2, end2) Apply @var{proc_lt}, @var{proc_eq}, @var{proc_gt} to the @@ -5285,12 +6665,13 @@ mismatch index, depending upon whether @var{s1} is less than, equal to, or greater than @var{s2}. The mismatch index is the largest index @var{i} such that for every 0 <= @var{j} < @var{i}, @var{s1}[@var{j}] = @var{s2}[@var{j}] -- that is, -@var{i} is the first position that does not match. The -character comparison is done case-insensitively. +@var{i} is the first position where the lowercased letters +do not match. + @end deffn string= -@c snarfed from srfi-13.c:1056 +@c snarfed from srfi-13.c:1088 @deffn {Scheme Procedure} string= s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_eq (s1, s2, start1, end1, start2, end2) Return @code{#f} if @var{s1} and @var{s2} are not equal, a true @@ -5298,7 +6679,7 @@ value otherwise. @end deffn string<> -@c snarfed from srfi-13.c:1095 +@c snarfed from srfi-13.c:1127 @deffn {Scheme Procedure} string<> s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_neq (s1, s2, start1, end1, start2, end2) Return @code{#f} if @var{s1} and @var{s2} are equal, a true @@ -5306,7 +6687,7 @@ value otherwise. @end deffn string< -@c snarfed from srfi-13.c:1138 +@c snarfed from srfi-13.c:1170 @deffn {Scheme Procedure} string< s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_lt (s1, s2, start1, end1, start2, end2) Return @code{#f} if @var{s1} is greater or equal to @var{s2}, a @@ -5314,7 +6695,7 @@ true value otherwise. @end deffn string> -@c snarfed from srfi-13.c:1181 +@c snarfed from srfi-13.c:1213 @deffn {Scheme Procedure} string> s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_gt (s1, s2, start1, end1, start2, end2) Return @code{#f} if @var{s1} is less or equal to @var{s2}, a @@ -5322,7 +6703,7 @@ true value otherwise. @end deffn string<= -@c snarfed from srfi-13.c:1224 +@c snarfed from srfi-13.c:1256 @deffn {Scheme Procedure} string<= s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_le (s1, s2, start1, end1, start2, end2) Return @code{#f} if @var{s1} is greater to @var{s2}, a true @@ -5330,7 +6711,7 @@ value otherwise. @end deffn string>= -@c snarfed from srfi-13.c:1267 +@c snarfed from srfi-13.c:1299 @deffn {Scheme Procedure} string>= s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_ge (s1, s2, start1, end1, start2, end2) Return @code{#f} if @var{s1} is less to @var{s2}, a true value @@ -5338,7 +6719,7 @@ otherwise. @end deffn string-ci= -@c snarfed from srfi-13.c:1311 +@c snarfed from srfi-13.c:1343 @deffn {Scheme Procedure} string-ci= s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_ci_eq (s1, s2, start1, end1, start2, end2) Return @code{#f} if @var{s1} and @var{s2} are not equal, a true @@ -5347,7 +6728,7 @@ case-insensitively. @end deffn string-ci<> -@c snarfed from srfi-13.c:1355 +@c snarfed from srfi-13.c:1387 @deffn {Scheme Procedure} string-ci<> s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_ci_neq (s1, s2, start1, end1, start2, end2) Return @code{#f} if @var{s1} and @var{s2} are equal, a true @@ -5356,7 +6737,7 @@ case-insensitively. @end deffn string-ci< -@c snarfed from srfi-13.c:1399 +@c snarfed from srfi-13.c:1431 @deffn {Scheme Procedure} string-ci< s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_ci_lt (s1, s2, start1, end1, start2, end2) Return @code{#f} if @var{s1} is greater or equal to @var{s2}, a @@ -5365,7 +6746,7 @@ case-insensitively. @end deffn string-ci> -@c snarfed from srfi-13.c:1443 +@c snarfed from srfi-13.c:1475 @deffn {Scheme Procedure} string-ci> s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_ci_gt (s1, s2, start1, end1, start2, end2) Return @code{#f} if @var{s1} is less or equal to @var{s2}, a @@ -5374,7 +6755,7 @@ case-insensitively. @end deffn string-ci<= -@c snarfed from srfi-13.c:1487 +@c snarfed from srfi-13.c:1519 @deffn {Scheme Procedure} string-ci<= s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_ci_le (s1, s2, start1, end1, start2, end2) Return @code{#f} if @var{s1} is greater to @var{s2}, a true @@ -5383,7 +6764,7 @@ case-insensitively. @end deffn string-ci>= -@c snarfed from srfi-13.c:1531 +@c snarfed from srfi-13.c:1563 @deffn {Scheme Procedure} string-ci>= s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_ci_ge (s1, s2, start1, end1, start2, end2) Return @code{#f} if @var{s1} is less to @var{s2}, a true value @@ -5392,21 +6773,21 @@ case-insensitively. @end deffn string-hash -@c snarfed from srfi-13.c:1576 +@c snarfed from srfi-13.c:1608 @deffn {Scheme Procedure} string-hash s [bound [start [end]]] @deffnx {C Function} scm_substring_hash (s, bound, start, end) Compute a hash value for @var{S}. the optional argument @var{bound} is a non-negative exact integer specifying the range of the hash function. A positive value restricts the return value to the range [0,bound). @end deffn string-hash-ci -@c snarfed from srfi-13.c:1593 +@c snarfed from srfi-13.c:1625 @deffn {Scheme Procedure} string-hash-ci s [bound [start [end]]] @deffnx {C Function} scm_substring_hash_ci (s, bound, start, end) Compute a hash value for @var{S}. the optional argument @var{bound} is a non-negative exact integer specifying the range of the hash function. A positive value restricts the return value to the range [0,bound). @end deffn string-prefix-length -@c snarfed from srfi-13.c:1605 +@c snarfed from srfi-13.c:1637 @deffn {Scheme Procedure} string-prefix-length s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_prefix_length (s1, s2, start1, end1, start2, end2) Return the length of the longest common prefix of the two @@ -5414,7 +6795,7 @@ strings. @end deffn string-prefix-length-ci -@c snarfed from srfi-13.c:1634 +@c snarfed from srfi-13.c:1669 @deffn {Scheme Procedure} string-prefix-length-ci s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_prefix_length_ci (s1, s2, start1, end1, start2, end2) Return the length of the longest common prefix of the two @@ -5422,7 +6803,7 @@ strings, ignoring character case. @end deffn string-suffix-length -@c snarfed from srfi-13.c:1663 +@c snarfed from srfi-13.c:1701 @deffn {Scheme Procedure} string-suffix-length s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_suffix_length (s1, s2, start1, end1, start2, end2) Return the length of the longest common suffix of the two @@ -5430,7 +6811,7 @@ strings. @end deffn string-suffix-length-ci -@c snarfed from srfi-13.c:1692 +@c snarfed from srfi-13.c:1733 @deffn {Scheme Procedure} string-suffix-length-ci s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_suffix_length_ci (s1, s2, start1, end1, start2, end2) Return the length of the longest common suffix of the two @@ -5438,35 +6819,35 @@ strings, ignoring character case. @end deffn string-prefix? -@c snarfed from srfi-13.c:1720 +@c snarfed from srfi-13.c:1764 @deffn {Scheme Procedure} string-prefix? s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_prefix_p (s1, s2, start1, end1, start2, end2) Is @var{s1} a prefix of @var{s2}? @end deffn string-prefix-ci? -@c snarfed from srfi-13.c:1749 +@c snarfed from srfi-13.c:1796 @deffn {Scheme Procedure} string-prefix-ci? s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_prefix_ci_p (s1, s2, start1, end1, start2, end2) Is @var{s1} a prefix of @var{s2}, ignoring character case? @end deffn string-suffix? -@c snarfed from srfi-13.c:1778 +@c snarfed from srfi-13.c:1828 @deffn {Scheme Procedure} string-suffix? s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_suffix_p (s1, s2, start1, end1, start2, end2) Is @var{s1} a suffix of @var{s2}? @end deffn string-suffix-ci? -@c snarfed from srfi-13.c:1807 +@c snarfed from srfi-13.c:1860 @deffn {Scheme Procedure} string-suffix-ci? s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_suffix_ci_p (s1, s2, start1, end1, start2, end2) Is @var{s1} a suffix of @var{s2}, ignoring character case? @end deffn string-index -@c snarfed from srfi-13.c:1848 +@c snarfed from srfi-13.c:1904 @deffn {Scheme Procedure} string-index s char_pred [start [end]] @deffnx {C Function} scm_string_index (s, char_pred, start, end) Search through the string @var{s} from left to right, returning @@ -5485,7 +6866,7 @@ is in the set @var{char_pred}, if it is a character set. @end deffn string-index-right -@c snarfed from srfi-13.c:1907 +@c snarfed from srfi-13.c:1969 @deffn {Scheme Procedure} string-index-right s char_pred [start [end]] @deffnx {C Function} scm_string_index_right (s, char_pred, start, end) Search through the string @var{s} from right to left, returning @@ -5504,7 +6885,7 @@ is in the set if @var{char_pred} is a character set. @end deffn string-rindex -@c snarfed from srfi-13.c:1966 +@c snarfed from srfi-13.c:2034 @deffn {Scheme Procedure} string-rindex s char_pred [start [end]] @deffnx {C Function} scm_string_rindex (s, char_pred, start, end) Search through the string @var{s} from right to left, returning @@ -5523,7 +6904,7 @@ is in the set if @var{char_pred} is a character set. @end deffn string-skip -@c snarfed from srfi-13.c:1986 +@c snarfed from srfi-13.c:2056 @deffn {Scheme Procedure} string-skip s char_pred [start [end]] @deffnx {C Function} scm_string_skip (s, char_pred, start, end) Search through the string @var{s} from left to right, returning @@ -5543,7 +6924,7 @@ is not in the set if @var{char_pred} is a character set. @end deffn string-skip-right -@c snarfed from srfi-13.c:2047 +@c snarfed from srfi-13.c:2123 @deffn {Scheme Procedure} string-skip-right s char_pred [start [end]] @deffnx {C Function} scm_string_skip_right (s, char_pred, start, end) Search through the string @var{s} from right to left, returning @@ -5563,7 +6944,7 @@ is not in the set if @var{char_pred} is a character set. @end deffn string-count -@c snarfed from srfi-13.c:2107 +@c snarfed from srfi-13.c:2190 @deffn {Scheme Procedure} string-count s char_pred [start [end]] @deffnx {C Function} scm_string_count (s, char_pred, start, end) Return the count of the number of characters in the string @@ -5582,7 +6963,7 @@ is in the set @var{char_pred}, if it is a character set. @end deffn string-contains -@c snarfed from srfi-13.c:2162 +@c snarfed from srfi-13.c:2247 @deffn {Scheme Procedure} string-contains s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_contains (s1, s2, start1, end1, start2, end2) Does string @var{s1} contain string @var{s2}? Return the index @@ -5592,7 +6973,7 @@ indicated substrings. @end deffn string-contains-ci -@c snarfed from srfi-13.c:2203 +@c snarfed from srfi-13.c:2294 @deffn {Scheme Procedure} string-contains-ci s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_contains_ci (s1, s2, start1, end1, start2, end2) Does string @var{s1} contain string @var{s2}? Return the index @@ -5603,7 +6984,7 @@ case-insensitively. @end deffn string-upcase! -@c snarfed from srfi-13.c:2261 +@c snarfed from srfi-13.c:2359 @deffn {Scheme Procedure} string-upcase! str [start [end]] @deffnx {C Function} scm_substring_upcase_x (str, start, end) Destructively upcase every character in @code{str}. @@ -5617,14 +6998,14 @@ y @end deffn string-upcase -@c snarfed from srfi-13.c:2282 +@c snarfed from srfi-13.c:2380 @deffn {Scheme Procedure} string-upcase str [start [end]] @deffnx {C Function} scm_substring_upcase (str, start, end) Upcase every character in @code{str}. @end deffn string-downcase! -@c snarfed from srfi-13.c:2328 +@c snarfed from srfi-13.c:2427 @deffn {Scheme Procedure} string-downcase! str [start [end]] @deffnx {C Function} scm_substring_downcase_x (str, start, end) Destructively downcase every character in @var{str}. @@ -5640,14 +7021,14 @@ y @end deffn string-downcase -@c snarfed from srfi-13.c:2349 +@c snarfed from srfi-13.c:2448 @deffn {Scheme Procedure} string-downcase str [start [end]] @deffnx {C Function} scm_substring_downcase (str, start, end) Downcase every character in @var{str}. @end deffn string-titlecase! -@c snarfed from srfi-13.c:2404 +@c snarfed from srfi-13.c:2504 @deffn {Scheme Procedure} string-titlecase! str [start [end]] @deffnx {C Function} scm_string_titlecase_x (str, start, end) Destructively titlecase every first character in a word in @@ -5655,14 +7036,14 @@ Destructively titlecase every first character in a word in @end deffn string-titlecase -@c snarfed from srfi-13.c:2420 +@c snarfed from srfi-13.c:2520 @deffn {Scheme Procedure} string-titlecase str [start [end]] @deffnx {C Function} scm_string_titlecase (str, start, end) Titlecase every first character in a word in @var{str}. @end deffn string-capitalize! -@c snarfed from srfi-13.c:2445 +@c snarfed from srfi-13.c:2542 @deffn {Scheme Procedure} string-capitalize! str @deffnx {C Function} scm_string_capitalize_x (str) Upcase the first character of every word in @var{str} @@ -5676,7 +7057,7 @@ y @result{} "Hello World" @end deffn string-capitalize -@c snarfed from srfi-13.c:2457 +@c snarfed from srfi-13.c:2554 @deffn {Scheme Procedure} string-capitalize str @deffnx {C Function} scm_string_capitalize (str) Return a freshly allocated string with the characters in @@ -5685,7 +7066,7 @@ capitalized. @end deffn string-reverse -@c snarfed from srfi-13.c:2488 +@c snarfed from srfi-13.c:2588 @deffn {Scheme Procedure} string-reverse str [start [end]] @deffnx {C Function} scm_string_reverse (str, start, end) Reverse the string @var{str}. The optional arguments @@ -5694,7 +7075,7 @@ operate on. @end deffn string-reverse! -@c snarfed from srfi-13.c:2512 +@c snarfed from srfi-13.c:2613 @deffn {Scheme Procedure} string-reverse! str [start [end]] @deffnx {C Function} scm_string_reverse_x (str, start, end) Reverse the string @var{str} in-place. The optional arguments @@ -5703,15 +7084,15 @@ operate on. The return value is unspecified. @end deffn string-append/shared -@c snarfed from srfi-13.c:2535 -@deffn {Scheme Procedure} string-append/shared . ls -@deffnx {C Function} scm_string_append_shared (ls) +@c snarfed from srfi-13.c:2635 +@deffn {Scheme Procedure} string-append/shared . rest +@deffnx {C Function} scm_string_append_shared (rest) Like @code{string-append}, but the result may share memory with the argument strings. @end deffn string-concatenate -@c snarfed from srfi-13.c:2556 +@c snarfed from srfi-13.c:2656 @deffn {Scheme Procedure} string-concatenate ls @deffnx {C Function} scm_string_concatenate (ls) Append the elements of @var{ls} (which must be strings) @@ -5720,7 +7101,7 @@ allocated string. @end deffn string-concatenate-reverse -@c snarfed from srfi-13.c:2578 +@c snarfed from srfi-13.c:2678 @deffn {Scheme Procedure} string-concatenate-reverse ls [final_string [end]] @deffnx {C Function} scm_string_concatenate_reverse (ls, final_string, end) Without optional arguments, this procedure is equivalent to @@ -5739,7 +7120,7 @@ Guaranteed to return a freshly allocated string. @end deffn string-concatenate/shared -@c snarfed from srfi-13.c:2647 +@c snarfed from srfi-13.c:2695 @deffn {Scheme Procedure} string-concatenate/shared ls @deffnx {C Function} scm_string_concatenate_shared (ls) Like @code{string-concatenate}, but the result may share memory @@ -5747,15 +7128,15 @@ with the strings in the list @var{ls}. @end deffn string-concatenate-reverse/shared -@c snarfed from srfi-13.c:2658 +@c snarfed from srfi-13.c:2706 @deffn {Scheme Procedure} string-concatenate-reverse/shared ls [final_string [end]] @deffnx {C Function} scm_string_concatenate_reverse_shared (ls, final_string, end) Like @code{string-concatenate-reverse}, but the result may -share memory with the the strings in the @var{ls} arguments. +share memory with the strings in the @var{ls} arguments. @end deffn string-map -@c snarfed from srfi-13.c:2671 +@c snarfed from srfi-13.c:2719 @deffn {Scheme Procedure} string-map proc s [start [end]] @deffnx {C Function} scm_string_map (proc, s, start, end) @var{proc} is a char->char procedure, it is mapped over @@ -5764,7 +7145,7 @@ string elements is not specified. @end deffn string-map! -@c snarfed from srfi-13.c:2704 +@c snarfed from srfi-13.c:2749 @deffn {Scheme Procedure} string-map! proc s [start [end]] @deffnx {C Function} scm_string_map_x (proc, s, start, end) @var{proc} is a char->char procedure, it is mapped over @@ -5774,7 +7155,7 @@ modified in-place, the return value is not specified. @end deffn string-fold -@c snarfed from srfi-13.c:2731 +@c snarfed from srfi-13.c:2776 @deffn {Scheme Procedure} string-fold kons knil s [start [end]] @deffnx {C Function} scm_string_fold (kons, knil, s, start, end) Fold @var{kons} over the characters of @var{s}, with @var{knil} @@ -5784,7 +7165,7 @@ result of @var{kons}' application. @end deffn string-fold-right -@c snarfed from srfi-13.c:2760 +@c snarfed from srfi-13.c:2807 @deffn {Scheme Procedure} string-fold-right kons knil s [start [end]] @deffnx {C Function} scm_string_fold_right (kons, knil, s, start, end) Fold @var{kons} over the characters of @var{s}, with @var{knil} @@ -5794,7 +7175,7 @@ result of @var{kons}' application. @end deffn string-unfold -@c snarfed from srfi-13.c:2803 +@c snarfed from srfi-13.c:2852 @deffn {Scheme Procedure} string-unfold p f g seed [base [make_final]] @deffnx {C Function} scm_string_unfold (p, f, g, seed, base, make_final) @itemize @bullet @@ -5818,7 +7199,7 @@ It defaults to @code{(lambda (x) )}. @end deffn string-unfold-right -@c snarfed from srfi-13.c:2866 +@c snarfed from srfi-13.c:2915 @deffn {Scheme Procedure} string-unfold-right p f g seed [base [make_final]] @deffnx {C Function} scm_string_unfold_right (p, f, g, seed, base, make_final) @itemize @bullet @@ -5842,7 +7223,7 @@ It defaults to @code{(lambda (x) )}. @end deffn string-for-each -@c snarfed from srfi-13.c:2913 +@c snarfed from srfi-13.c:2962 @deffn {Scheme Procedure} string-for-each proc s [start [end]] @deffnx {C Function} scm_string_for_each (proc, s, start, end) @var{proc} is mapped over @var{s} in left-to-right order. The @@ -5850,7 +7231,7 @@ return value is not specified. @end deffn string-for-each-index -@c snarfed from srfi-13.c:2937 +@c snarfed from srfi-13.c:2988 @deffn {Scheme Procedure} string-for-each-index proc s [start [end]] @deffnx {C Function} scm_string_for_each_index (proc, s, start, end) @var{proc} is mapped over @var{s} in left-to-right order. The @@ -5858,7 +7239,7 @@ return value is not specified. @end deffn xsubstring -@c snarfed from srfi-13.c:2967 +@c snarfed from srfi-13.c:3020 @deffn {Scheme Procedure} xsubstring s from [to [start [end]]] @deffnx {C Function} scm_xsubstring (s, from, to, start, end) This is the @emph{extended substring} procedure that implements @@ -5874,7 +7255,7 @@ defaults to @var{from} + (@var{end} - @var{start}). @end deffn string-xcopy! -@c snarfed from srfi-13.c:3010 +@c snarfed from srfi-13.c:3067 @deffn {Scheme Procedure} string-xcopy! target tstart s sfrom [sto [start [end]]] @deffnx {C Function} scm_string_xcopy_x (target, tstart, s, sfrom, sto, start, end) Exactly the same as @code{xsubstring}, but the extracted text @@ -5885,7 +7266,7 @@ cannot copy a string on top of itself. @end deffn string-replace -@c snarfed from srfi-13.c:3058 +@c snarfed from srfi-13.c:3117 @deffn {Scheme Procedure} string-replace s1 s2 [start1 [end1 [start2 [end2]]]] @deffnx {C Function} scm_string_replace (s1, s2, start1, end1, start2, end2) Return the string @var{s1}, but with the characters @@ -5894,7 +7275,7 @@ Return the string @var{s1}, but with the characters @end deffn string-tokenize -@c snarfed from srfi-13.c:3093 +@c snarfed from srfi-13.c:3154 @deffn {Scheme Procedure} string-tokenize s [token_set [start [end]]] @deffnx {C Function} scm_string_tokenize (s, token_set, start, end) Split the string @var{s} into a list of substrings, where each @@ -5907,7 +7288,7 @@ of @var{s}. @end deffn string-split -@c snarfed from srfi-13.c:3157 +@c snarfed from srfi-13.c:3220 @deffn {Scheme Procedure} string-split str chr @deffnx {C Function} scm_string_split (str, chr) Split the string @var{str} into the a list of the substrings delimited @@ -5931,7 +7312,7 @@ result list. @end deffn string-filter -@c snarfed from srfi-13.c:3195 +@c snarfed from srfi-13.c:3258 @deffn {Scheme Procedure} string-filter s char_pred [start [end]] @deffnx {C Function} scm_string_filter (s, char_pred, start, end) Filter the string @var{s}, retaining only those characters that @@ -5942,7 +7323,7 @@ character set, it is tested for membership. @end deffn string-delete -@c snarfed from srfi-13.c:3265 +@c snarfed from srfi-13.c:3330 @deffn {Scheme Procedure} string-delete s char_pred [start [end]] @deffnx {C Function} scm_string_delete (s, char_pred, start, end) Filter the string @var{s}, retaining only those characters that @@ -6363,7 +7744,8 @@ character sets. string=? @c snarfed from strorder.c:50 -@deffn {Scheme Procedure} string=? s1 s2 +@deffn {Scheme Procedure} string=? [s1 [s2 . rest]] +@deffnx {C Function} scm_i_string_equal_p (s1, s2, rest) Lexicographic equality predicate; return @code{#t} if the two strings are the same length and contain the same characters in the same positions, otherwise return @code{#f}. @@ -6376,7 +7758,8 @@ characters. string-ci=? @c snarfed from strorder.c:62 -@deffn {Scheme Procedure} string-ci=? s1 s2 +@deffn {Scheme Procedure} string-ci=? [s1 [s2 . rest]] +@deffnx {C Function} scm_i_string_ci_equal_p (s1, s2, rest) Case-insensitive string equality predicate; return @code{#t} if the two strings are the same length and their component characters match (ignoring case) at each position; otherwise @@ -6385,35 +7768,40 @@ return @code{#f}. string? @c snarfed from strorder.c:92 -@deffn {Scheme Procedure} string>? s1 s2 +@deffn {Scheme Procedure} string>? [s1 [s2 . rest]] +@deffnx {C Function} scm_i_string_gr_p (s1, s2, rest) Lexicographic ordering predicate; return @code{#t} if @var{s1} is lexicographically greater than @var{s2}. @end deffn string>=? @c snarfed from strorder.c:102 -@deffn {Scheme Procedure} string>=? s1 s2 +@deffn {Scheme Procedure} string>=? [s1 [s2 . rest]] +@deffnx {C Function} scm_i_string_geq_p (s1, s2, rest) Lexicographic ordering predicate; return @code{#t} if @var{s1} is lexicographically greater than or equal to @var{s2}. @end deffn string-ci? @c snarfed from strorder.c:135 -@deffn {Scheme Procedure} string-ci>? s1 s2 +@deffn {Scheme Procedure} string-ci>? [s1 [s2 . rest]] +@deffnx {C Function} scm_i_string_ci_gr_p (s1, s2, rest) Case insensitive lexicographic ordering predicate; return @code{#t} if @var{s1} is lexicographically greater than @var{s2} regardless of case. @@ -6437,7 +7827,8 @@ Case insensitive lexicographic ordering predicate; return string-ci>=? @c snarfed from strorder.c:146 -@deffn {Scheme Procedure} string-ci>=? s1 s2 +@deffn {Scheme Procedure} string-ci>=? [s1 [s2 . rest]] +@deffnx {C Function} scm_i_string_ci_geq_p (s1, s2, rest) Case insensitive lexicographic ordering predicate; return @code{#t} if @var{s1} is lexicographically greater than or equal to @var{s2} regardless of case. @@ -6514,7 +7905,7 @@ procedure returns. @end deffn make-struct-layout -@c snarfed from struct.c:55 +@c snarfed from struct.c:56 @deffn {Scheme Procedure} make-struct-layout fields @deffnx {C Function} scm_make_struct_layout (fields) Return a new structure layout object. @@ -6530,7 +7921,7 @@ indicate that the field is a tail-array. @end deffn struct? -@c snarfed from struct.c:222 +@c snarfed from struct.c:223 @deffn {Scheme Procedure} struct? x @deffnx {C Function} scm_struct_p (x) Return @code{#t} iff @var{x} is a structure object, else @@ -6538,14 +7929,14 @@ Return @code{#t} iff @var{x} is a structure object, else @end deffn struct-vtable? -@c snarfed from struct.c:231 +@c snarfed from struct.c:232 @deffn {Scheme Procedure} struct-vtable? x @deffnx {C Function} scm_struct_vtable_p (x) Return @code{#t} iff @var{x} is a vtable structure. @end deffn make-struct -@c snarfed from struct.c:417 +@c snarfed from struct.c:418 @deffn {Scheme Procedure} make-struct vtable tail_array_size . init @deffnx {C Function} scm_make_struct (vtable, tail_array_size, init) Create a new structure. @@ -6576,7 +7967,7 @@ For more information, see the documentation for @code{make-vtable-vtable}. @end deffn make-vtable-vtable -@c snarfed from struct.c:501 +@c snarfed from struct.c:502 @deffn {Scheme Procedure} make-vtable-vtable user_fields tail_array_size . init @deffnx {C Function} scm_make_vtable_vtable (user_fields, tail_array_size, init) Return a new, self-describing vtable structure. @@ -6638,7 +8029,7 @@ ball @result{} # @end deffn struct-ref -@c snarfed from struct.c:541 +@c snarfed from struct.c:542 @deffn {Scheme Procedure} struct-ref handle pos @deffnx {Scheme Procedure} struct-set! struct n value @deffnx {C Function} scm_struct_ref (handle, pos) @@ -6651,7 +8042,7 @@ integer value small enough to fit in one machine word. @end deffn struct-set! -@c snarfed from struct.c:620 +@c snarfed from struct.c:621 @deffn {Scheme Procedure} struct-set! handle pos val @deffnx {C Function} scm_struct_set_x (handle, pos, val) Set the slot of the structure @var{handle} with index @var{pos} @@ -6660,35 +8051,35 @@ to. @end deffn struct-vtable -@c snarfed from struct.c:691 +@c snarfed from struct.c:692 @deffn {Scheme Procedure} struct-vtable handle @deffnx {C Function} scm_struct_vtable (handle) Return the vtable structure that describes the type of @var{struct}. @end deffn struct-vtable-tag -@c snarfed from struct.c:702 +@c snarfed from struct.c:703 @deffn {Scheme Procedure} struct-vtable-tag handle @deffnx {C Function} scm_struct_vtable_tag (handle) Return the vtable tag of the structure @var{handle}. @end deffn struct-vtable-name -@c snarfed from struct.c:741 +@c snarfed from struct.c:742 @deffn {Scheme Procedure} struct-vtable-name vtable @deffnx {C Function} scm_struct_vtable_name (vtable) Return the name of the vtable @var{vtable}. @end deffn set-struct-vtable-name! -@c snarfed from struct.c:751 +@c snarfed from struct.c:752 @deffn {Scheme Procedure} set-struct-vtable-name! vtable name @deffnx {C Function} scm_set_struct_vtable_name_x (vtable, name) Set the name of the vtable @var{vtable} to @var{name}. @end deffn symbol? -@c snarfed from symbols.c:158 +@c snarfed from symbols.c:156 @deffn {Scheme Procedure} symbol? obj @deffnx {C Function} scm_symbol_p (obj) Return @code{#t} if @var{obj} is a symbol, otherwise return @@ -6696,7 +8087,7 @@ Return @code{#t} if @var{obj} is a symbol, otherwise return @end deffn symbol-interned? -@c snarfed from symbols.c:168 +@c snarfed from symbols.c:166 @deffn {Scheme Procedure} symbol-interned? symbol @deffnx {C Function} scm_symbol_interned_p (symbol) Return @code{#t} if @var{symbol} is interned, otherwise return @@ -6704,14 +8095,14 @@ Return @code{#t} if @var{symbol} is interned, otherwise return @end deffn make-symbol -@c snarfed from symbols.c:180 +@c snarfed from symbols.c:178 @deffn {Scheme Procedure} make-symbol name @deffnx {C Function} scm_make_symbol (name) Return a new uninterned symbol with the name @var{name}. The returned symbol is guaranteed to be unique and future calls to @code{string->symbol} will not return it. @end deffn symbol->string -@c snarfed from symbols.c:212 +@c snarfed from symbols.c:210 @deffn {Scheme Procedure} symbol->string s @deffnx {C Function} scm_symbol_to_string (s) Return the name of @var{symbol} as a string. If the symbol was @@ -6740,7 +8131,7 @@ standard case is lower case: @end deffn string->symbol -@c snarfed from symbols.c:242 +@c snarfed from symbols.c:240 @deffn {Scheme Procedure} string->symbol string @deffnx {C Function} scm_string_to_symbol (string) Return the symbol whose name is @var{string}. This procedure @@ -6766,7 +8157,7 @@ standard case is lower case: @end deffn string-ci->symbol -@c snarfed from symbols.c:254 +@c snarfed from symbols.c:252 @deffn {Scheme Procedure} string-ci->symbol str @deffnx {C Function} scm_string_ci_to_symbol (str) Return the symbol whose name is @var{str}. @var{str} is @@ -6775,7 +8166,7 @@ is currently reading symbols case-insensitively. @end deffn gensym -@c snarfed from symbols.c:271 +@c snarfed from symbols.c:269 @deffn {Scheme Procedure} gensym [prefix] @deffnx {C Function} scm_gensym (prefix) Create a new symbol with a name constructed from a prefix and @@ -6786,147 +8177,149 @@ resetting the counter. @end deffn symbol-hash -@c snarfed from symbols.c:297 +@c snarfed from symbols.c:295 @deffn {Scheme Procedure} symbol-hash symbol @deffnx {C Function} scm_symbol_hash (symbol) Return a hash value for @var{symbol}. @end deffn symbol-fref -@c snarfed from symbols.c:307 +@c snarfed from symbols.c:305 @deffn {Scheme Procedure} symbol-fref s @deffnx {C Function} scm_symbol_fref (s) Return the contents of @var{symbol}'s @dfn{function slot}. @end deffn symbol-pref -@c snarfed from symbols.c:318 +@c snarfed from symbols.c:316 @deffn {Scheme Procedure} symbol-pref s @deffnx {C Function} scm_symbol_pref (s) Return the @dfn{property list} currently associated with @var{symbol}. @end deffn symbol-fset! -@c snarfed from symbols.c:329 +@c snarfed from symbols.c:327 @deffn {Scheme Procedure} symbol-fset! s val @deffnx {C Function} scm_symbol_fset_x (s, val) Change the binding of @var{symbol}'s function slot. @end deffn symbol-pset! -@c snarfed from symbols.c:341 +@c snarfed from symbols.c:339 @deffn {Scheme Procedure} symbol-pset! s val @deffnx {C Function} scm_symbol_pset_x (s, val) Change the binding of @var{symbol}'s property slot. @end deffn call-with-new-thread -@c snarfed from threads.c:428 -@deffn {Scheme Procedure} call-with-new-thread thunk handler +@c snarfed from threads.c:611 +@deffn {Scheme Procedure} call-with-new-thread thunk [handler] @deffnx {C Function} scm_call_with_new_thread (thunk, handler) -Evaluate @code{(@var{thunk})} in a new thread, and new dynamic context, returning a new thread object representing the thread. If an error occurs during evaluation, call error-thunk, passing it an error code describing the condition. If this happens, the error-thunk is called outside the scope of the new root -- it is called in the same dynamic context in which with-new-thread was evaluated, but not in the callers thread. All the evaluation rules for dynamic roots apply to threads. +Call @code{thunk} in a new thread and with a new dynamic state, +returning a new thread object representing the thread. The procedure +@var{thunk} is called via @code{with-continuation-barrier}. + +When @var{handler} is specified, then @var{thunk} is called from +within a @code{catch} with tag @code{#t} that has @var{handler} as its +handler. This catch is established inside the continuation barrier. + +Once @var{thunk} or @var{handler} returns, the return value is made +the @emph{exit value} of the thread and the thread is terminated. @end deffn yield -@c snarfed from threads.c:443 +@c snarfed from threads.c:722 @deffn {Scheme Procedure} yield @deffnx {C Function} scm_yield () Move the calling thread to the end of the scheduling queue. @end deffn join-thread -@c snarfed from threads.c:453 +@c snarfed from threads.c:732 @deffn {Scheme Procedure} join-thread thread @deffnx {C Function} scm_join_thread (thread) Suspend execution of the calling thread until the target @var{thread} terminates, unless the target @var{thread} has already terminated. @end deffn - make-fair-mutex -@c snarfed from threads.c:508 -@deffn {Scheme Procedure} make-fair-mutex -@deffnx {C Function} scm_make_fair_mutex () -Create a new fair mutex object. -@end deffn - - make-fair-condition-variable -@c snarfed from threads.c:628 -@deffn {Scheme Procedure} make-fair-condition-variable -@deffnx {C Function} scm_make_fair_condition_variable () -Make a new fair condition variable. -@end deffn - make-mutex -@c snarfed from threads.c:691 +@c snarfed from threads.c:828 @deffn {Scheme Procedure} make-mutex @deffnx {C Function} scm_make_mutex () -Create a new mutex object. +Create a new mutex. +@end deffn + + make-recursive-mutex +@c snarfed from threads.c:837 +@deffn {Scheme Procedure} make-recursive-mutex +@deffnx {C Function} scm_make_recursive_mutex () +Create a new recursive mutex. @end deffn lock-mutex -@c snarfed from threads.c:707 +@c snarfed from threads.c:883 @deffn {Scheme Procedure} lock-mutex mx @deffnx {C Function} scm_lock_mutex (mx) Lock @var{mutex}. If the mutex is already locked, the calling thread blocks until the mutex becomes available. The function returns when the calling thread owns the lock on @var{mutex}. Locking a mutex that a thread already owns will succeed right away and will not block the thread. That is, Guile's mutexes are @emph{recursive}. @end deffn try-mutex -@c snarfed from threads.c:733 -@deffn {Scheme Procedure} try-mutex mx -@deffnx {C Function} scm_try_mutex (mx) +@c snarfed from threads.c:931 +@deffn {Scheme Procedure} try-mutex mutex +@deffnx {C Function} scm_try_mutex (mutex) Try to lock @var{mutex}. If the mutex is already locked by someone else, return @code{#f}. Else lock the mutex and return @code{#t}. @end deffn unlock-mutex -@c snarfed from threads.c:768 +@c snarfed from threads.c:976 @deffn {Scheme Procedure} unlock-mutex mx @deffnx {C Function} scm_unlock_mutex (mx) Unlocks @var{mutex} if the calling thread owns the lock on @var{mutex}. Calling unlock-mutex on a mutex not owned by the current thread results in undefined behaviour. Once a mutex has been unlocked, one thread blocked on @var{mutex} is awakened and grabs the mutex lock. Every call to @code{lock-mutex} by this thread must be matched with a call to @code{unlock-mutex}. Only the last call to @code{unlock-mutex} will actually unlock the mutex. @end deffn make-condition-variable -@c snarfed from threads.c:808 +@c snarfed from threads.c:1052 @deffn {Scheme Procedure} make-condition-variable @deffnx {C Function} scm_make_condition_variable () Make a new condition variable. @end deffn wait-condition-variable -@c snarfed from threads.c:827 +@c snarfed from threads.c:1120 @deffn {Scheme Procedure} wait-condition-variable cv mx [t] @deffnx {C Function} scm_timed_wait_condition_variable (cv, mx, t) Wait until @var{cond-var} has been signalled. While waiting, @var{mutex} is atomically unlocked (as with @code{unlock-mutex}) and is locked again when this function returns. When @var{time} is given, it specifies a point in time where the waiting should be aborted. It can be either a integer as returned by @code{current-time} or a pair as returned by @code{gettimeofday}. When the waiting is aborted the mutex is locked and @code{#f} is returned. When the condition variable is in fact signalled, the mutex is also locked and @code{#t} is returned. @end deffn signal-condition-variable -@c snarfed from threads.c:884 +@c snarfed from threads.c:1157 @deffn {Scheme Procedure} signal-condition-variable cv @deffnx {C Function} scm_signal_condition_variable (cv) Wake up one thread that is waiting for @var{cv} @end deffn broadcast-condition-variable -@c snarfed from threads.c:901 +@c snarfed from threads.c:1177 @deffn {Scheme Procedure} broadcast-condition-variable cv @deffnx {C Function} scm_broadcast_condition_variable (cv) Wake up all threads that are waiting for @var{cv}. @end deffn current-thread -@c snarfed from threads.c:1103 +@c snarfed from threads.c:1354 @deffn {Scheme Procedure} current-thread @deffnx {C Function} scm_current_thread () Return the thread that called this function. @end deffn all-threads -@c snarfed from threads.c:1112 +@c snarfed from threads.c:1372 @deffn {Scheme Procedure} all-threads @deffnx {C Function} scm_all_threads () Return a list of all threads. @end deffn thread-exited? -@c snarfed from threads.c:1127 +@c snarfed from threads.c:1398 @deffn {Scheme Procedure} thread-exited? thread @deffnx {C Function} scm_thread_exited_p (thread) Return @code{#t} iff @var{thread} has exited. @@ -6934,7 +8327,7 @@ Return @code{#t} iff @var{thread} has exited. @end deffn catch -@c snarfed from throw.c:500 +@c snarfed from throw.c:512 @deffn {Scheme Procedure} catch key thunk handler @deffnx {C Function} scm_catch (key, thunk, handler) Invoke @var{thunk} in the dynamic context of @var{handler} for @@ -6958,7 +8351,7 @@ match this call to @code{catch}. @end deffn lazy-catch -@c snarfed from throw.c:528 +@c snarfed from throw.c:540 @deffn {Scheme Procedure} lazy-catch key thunk handler @deffnx {C Function} scm_lazy_catch (key, thunk, handler) This behaves exactly like @code{catch}, except that it does @@ -6968,7 +8361,7 @@ it must throw to another catch, or otherwise exit non-locally. @end deffn throw -@c snarfed from throw.c:561 +@c snarfed from throw.c:573 @deffn {Scheme Procedure} throw key . args @deffnx {C Function} scm_throw (key, args) Invoke the catch form matching @var{key}, passing @var{args} to the @@ -7040,7 +8433,7 @@ Throws an error if @var{var} is not a variable object. @end deffn vector? -@c snarfed from vectors.c:35 +@c snarfed from vectors.c:91 @deffn {Scheme Procedure} vector? obj @deffnx {C Function} scm_vector_p (obj) Return @code{#t} if @var{obj} is a vector, otherwise return @@ -7048,13 +8441,13 @@ Return @code{#t} if @var{obj} is a vector, otherwise return @end deffn list->vector -@c snarfed from vectors.c:52 +@c snarfed from vectors.c:123 @deffn {Scheme Procedure} list->vector implemented by the C function "scm_vector" @end deffn vector -@c snarfed from vectors.c:69 +@c snarfed from vectors.c:140 @deffn {Scheme Procedure} vector . l @deffnx {Scheme Procedure} list->vector l @deffnx {C Function} scm_vector (l) @@ -7067,7 +8460,7 @@ given arguments. Analogous to @code{list}. @end deffn make-vector -@c snarfed from vectors.c:163 +@c snarfed from vectors.c:276 @deffn {Scheme Procedure} make-vector k [fill] @deffnx {C Function} scm_make_vector (k, fill) Return a newly allocated vector of @var{k} elements. If a @@ -7076,8 +8469,15 @@ second argument is given, then each position is initialized to unspecified. @end deffn + vector-copy +@c snarfed from vectors.c:318 +@deffn {Scheme Procedure} vector-copy vec +@deffnx {C Function} scm_vector_copy (vec) +Return a copy of @var{vec}. +@end deffn + vector->list -@c snarfed from vectors.c:211 +@c snarfed from vectors.c:389 @deffn {Scheme Procedure} vector->list v @deffnx {C Function} scm_vector_to_list (v) Return a newly allocated list composed of the elements of @var{v}. @@ -7089,7 +8489,7 @@ Return a newly allocated list composed of the elements of @var{v}. @end deffn vector-fill! -@c snarfed from vectors.c:228 +@c snarfed from vectors.c:413 @deffn {Scheme Procedure} vector-fill! v fill @deffnx {C Function} scm_vector_fill_x (v, fill) Store @var{fill} in every position of @var{vector}. The value @@ -7097,7 +8497,7 @@ returned by @code{vector-fill!} is unspecified. @end deffn vector-move-left! -@c snarfed from vectors.c:260 +@c snarfed from vectors.c:450 @deffn {Scheme Procedure} vector-move-left! vec1 start1 end1 vec2 start2 @deffnx {C Function} scm_vector_move_left_x (vec1, start1, end1, vec2, start2) Copy elements from @var{vec1}, positions @var{start1} to @var{end1}, @@ -7111,17 +8511,56 @@ same vector, @code{vector-move-left!} is usually appropriate when @end deffn vector-move-right! -@c snarfed from vectors.c:290 +@c snarfed from vectors.c:488 @deffn {Scheme Procedure} vector-move-right! vec1 start1 end1 vec2 start2 @deffnx {C Function} scm_vector_move_right_x (vec1, start1, end1, vec2, start2) Copy elements from @var{vec1}, positions @var{start1} to @var{end1}, to @var{vec2} starting at position @var{start2}. @var{start1} and @var{start2} are inclusive indices; @var{end1} is exclusive. -@code{vector-move-right!} copies elements in rightmost order. -Therefore, in the case where @var{vec1} and @var{vec2} refer to the -same vector, @code{vector-move-right!} is usually appropriate when -@var{start1} is less than @var{start2}. +@code{vector-move-right!} copies elements in rightmost order. +Therefore, in the case where @var{vec1} and @var{vec2} refer to the +same vector, @code{vector-move-right!} is usually appropriate when +@var{start1} is less than @var{start2}. +@end deffn + + generalized-vector? +@c snarfed from vectors.c:537 +@deffn {Scheme Procedure} generalized-vector? obj +@deffnx {C Function} scm_generalized_vector_p (obj) +Return @code{#t} if @var{obj} is a vector, string, +bitvector, or uniform numeric vector. +@end deffn + + generalized-vector-length +@c snarfed from vectors.c:569 +@deffn {Scheme Procedure} generalized-vector-length v +@deffnx {C Function} scm_generalized_vector_length (v) +Return the length of the generalized vector @var{v}. +@end deffn + + generalized-vector-ref +@c snarfed from vectors.c:594 +@deffn {Scheme Procedure} generalized-vector-ref v idx +@deffnx {C Function} scm_generalized_vector_ref (v, idx) +Return the element at index @var{idx} of the +generalized vector @var{v}. +@end deffn + + generalized-vector-set! +@c snarfed from vectors.c:619 +@deffn {Scheme Procedure} generalized-vector-set! v idx val +@deffnx {C Function} scm_generalized_vector_set_x (v, idx, val) +Set the element at index @var{idx} of the +generalized vector @var{v} to @var{val}. +@end deffn + + generalized-vector->list +@c snarfed from vectors.c:630 +@deffn {Scheme Procedure} generalized-vector->list v +@deffnx {C Function} scm_generalized_vector_to_list (v) +Return a new list whose elements are the elements of the +generalized vector @var{v}. @end deffn major-version @@ -7181,7 +8620,7 @@ Return a string describing Guile's effective version number. @end deffn make-soft-port -@c snarfed from vports.c:183 +@c snarfed from vports.c:185 @deffn {Scheme Procedure} make-soft-port pv modes @deffnx {C Function} scm_make_soft_port (pv, modes) Return a port capable of receiving or delivering characters as @@ -7231,7 +8670,7 @@ For example: @end deffn make-weak-vector -@c snarfed from weaks.c:117 +@c snarfed from weaks.c:74 @deffn {Scheme Procedure} make-weak-vector size [fill] @deffnx {C Function} scm_make_weak_vector (size, fill) Return a weak vector with @var{size} elements. If the optional @@ -7241,13 +8680,13 @@ empty list. @end deffn list->weak-vector -@c snarfed from weaks.c:125 +@c snarfed from weaks.c:82 @deffn {Scheme Procedure} list->weak-vector implemented by the C function "scm_weak_vector" @end deffn weak-vector -@c snarfed from weaks.c:133 +@c snarfed from weaks.c:90 @deffn {Scheme Procedure} weak-vector . l @deffnx {Scheme Procedure} list->weak-vector l @deffnx {C Function} scm_weak_vector (l) @@ -7258,7 +8697,7 @@ the same way @code{list->vector} would. @end deffn weak-vector? -@c snarfed from weaks.c:164 +@c snarfed from weaks.c:120 @deffn {Scheme Procedure} weak-vector? obj @deffnx {C Function} scm_weak_vector_p (obj) Return @code{#t} if @var{obj} is a weak vector. Note that all @@ -7266,7 +8705,7 @@ weak hashes are also weak vectors. @end deffn make-weak-key-alist-vector -@c snarfed from weaks.c:182 +@c snarfed from weaks.c:138 @deffn {Scheme Procedure} make-weak-key-alist-vector [size] @deffnx {Scheme Procedure} make-weak-value-alist-vector size @deffnx {Scheme Procedure} make-doubly-weak-alist-vector size @@ -7280,7 +8719,7 @@ would modify regular hash tables. (@pxref{Hash Tables}) @end deffn make-weak-value-alist-vector -@c snarfed from weaks.c:194 +@c snarfed from weaks.c:150 @deffn {Scheme Procedure} make-weak-value-alist-vector [size] @deffnx {C Function} scm_make_weak_value_alist_vector (size) Return a hash table with weak values with @var{size} buckets. @@ -7288,7 +8727,7 @@ Return a hash table with weak values with @var{size} buckets. @end deffn make-doubly-weak-alist-vector -@c snarfed from weaks.c:206 +@c snarfed from weaks.c:162 @deffn {Scheme Procedure} make-doubly-weak-alist-vector size @deffnx {C Function} scm_make_doubly_weak_alist_vector (size) Return a hash table with weak keys and values with @var{size} @@ -7296,7 +8735,7 @@ buckets. (@pxref{Hash Tables}) @end deffn weak-key-alist-vector? -@c snarfed from weaks.c:221 +@c snarfed from weaks.c:177 @deffn {Scheme Procedure} weak-key-alist-vector? obj @deffnx {Scheme Procedure} weak-value-alist-vector? obj @deffnx {Scheme Procedure} doubly-weak-alist-vector? obj @@ -7307,115 +8746,21 @@ nor a weak value hash table. @end deffn weak-value-alist-vector? -@c snarfed from weaks.c:231 +@c snarfed from weaks.c:187 @deffn {Scheme Procedure} weak-value-alist-vector? obj @deffnx {C Function} scm_weak_value_alist_vector_p (obj) Return @code{#t} if @var{obj} is a weak value hash table. @end deffn doubly-weak-alist-vector? -@c snarfed from weaks.c:241 +@c snarfed from weaks.c:197 @deffn {Scheme Procedure} doubly-weak-alist-vector? obj @deffnx {C Function} scm_doubly_weak_alist_vector_p (obj) Return @code{#t} if @var{obj} is a doubly weak hash table. @end deffn - dynamic-link -@c snarfed from dynl.c:149 -@deffn {Scheme Procedure} dynamic-link filename -@deffnx {C Function} scm_dynamic_link (filename) -Find the shared object (shared library) denoted by -@var{filename} and link it into the running Guile -application. The returned -scheme object is a ``handle'' for the library which can -be passed to @code{dynamic-func}, @code{dynamic-call} etc. - -Searching for object files is system dependent. Normally, -if @var{filename} does have an explicit directory it will -be searched for in locations -such as @file{/usr/lib} and @file{/usr/local/lib}. -@end deffn - - dynamic-object? -@c snarfed from dynl.c:168 -@deffn {Scheme Procedure} dynamic-object? obj -@deffnx {C Function} scm_dynamic_object_p (obj) -Return @code{#t} if @var{obj} is a dynamic object handle, -or @code{#f} otherwise. -@end deffn - - dynamic-unlink -@c snarfed from dynl.c:182 -@deffn {Scheme Procedure} dynamic-unlink dobj -@deffnx {C Function} scm_dynamic_unlink (dobj) -Unlink a dynamic object from the application, if possible. The -object must have been linked by @code{dynamic-link}, with -@var{dobj} the corresponding handle. After this procedure -is called, the handle can no longer be used to access the -object. -@end deffn - - dynamic-func -@c snarfed from dynl.c:207 -@deffn {Scheme Procedure} dynamic-func name dobj -@deffnx {C Function} scm_dynamic_func (name, dobj) -Return a ``handle'' for the function @var{name} in the -shared object referred to by @var{dobj}. The handle -can be passed to @code{dynamic-call} to actually -call the function. - -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{name} -since it will be added automatically when necessary. -@end deffn - - dynamic-call -@c snarfed from dynl.c:253 -@deffn {Scheme Procedure} dynamic-call func dobj -@deffnx {C Function} scm_dynamic_call (func, dobj) -Call a C function in a dynamic object. Two styles of -invocation are supported: - -@itemize @bullet -@item @var{func} can be a function handle returned by -@code{dynamic-func}. In this case @var{dobj} is -ignored -@item @var{func} can be a string with the name of the -function to call, with @var{dobj} the handle of the -dynamic object in which to find the function. -This is equivalent to -@smallexample - -(dynamic-call (dynamic-func @var{func} @var{dobj}) #f) -@end smallexample -@end itemize - -In either case, the function is passed no arguments -and its return value is ignored. -@end deffn - - dynamic-args-call -@c snarfed from dynl.c:285 -@deffn {Scheme Procedure} dynamic-args-call func dobj args -@deffnx {C Function} scm_dynamic_args_call (func, dobj, args) -Call the C function indicated by @var{func} and @var{dobj}, -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}. -@end deffn - array-fill! -@c snarfed from ramap.c:438 +@c snarfed from ramap.c:352 @deffn {Scheme Procedure} array-fill! ra fill @deffnx {C Function} scm_array_fill_x (ra, fill) Store @var{fill} in every element of @var{array}. The value returned @@ -7423,13 +8768,13 @@ is unspecified. @end deffn array-copy-in-order! -@c snarfed from ramap.c:810 +@c snarfed from ramap.c:399 @deffn {Scheme Procedure} array-copy-in-order! implemented by the C function "scm_array_copy_x" @end deffn array-copy! -@c snarfed from ramap.c:819 +@c snarfed from ramap.c:408 @deffn {Scheme Procedure} array-copy! src dst @deffnx {Scheme Procedure} array-copy-in-order! src dst @deffnx {C Function} scm_array_copy_x (src, dst) @@ -7440,13 +8785,13 @@ dimension. The order is unspecified. @end deffn array-map-in-order! -@c snarfed from ramap.c:1494 +@c snarfed from ramap.c:798 @deffn {Scheme Procedure} array-map-in-order! implemented by the C function "scm_array_map_x" @end deffn array-map! -@c snarfed from ramap.c:1505 +@c snarfed from ramap.c:809 @deffn {Scheme Procedure} array-map! ra0 proc . lra @deffnx {Scheme Procedure} array-map-in-order! ra0 proc . lra @deffnx {C Function} scm_array_map_x (ra0, proc, lra) @@ -7459,7 +8804,7 @@ unspecified. The order of application is unspecified. @end deffn array-for-each -@c snarfed from ramap.c:1651 +@c snarfed from ramap.c:950 @deffn {Scheme Procedure} array-for-each proc ra0 . lra @deffnx {C Function} scm_array_for_each (proc, ra0, lra) Apply @var{proc} to each tuple of elements of @var{array0} @dots{} @@ -7467,7 +8812,7 @@ in row-major order. The value returned is unspecified. @end deffn array-index-map! -@c snarfed from ramap.c:1679 +@c snarfed from ramap.c:978 @deffn {Scheme Procedure} array-index-map! ra proc @deffnx {C Function} scm_array_index_map_x (ra, proc) Apply @var{proc} to the indices of each element of @var{array} in @@ -7490,35 +8835,35 @@ Another example: @end lisp @end deffn - uniform-vector-length -@c snarfed from unif.c:211 -@deffn {Scheme Procedure} uniform-vector-length v -@deffnx {C Function} scm_uniform_vector_length (v) -Return the number of elements in @var{uve}. -@end deffn - array? -@c snarfed from unif.c:245 -@deffn {Scheme Procedure} array? v [prot] -@deffnx {C Function} scm_array_p (v, prot) +@c snarfed from unif.c:501 +@deffn {Scheme Procedure} array? obj [prot] +@deffnx {C Function} scm_array_p (obj, prot) Return @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. +not. +@end deffn + + typed-array? +@c snarfed from unif.c:548 +@deffn {Scheme Procedure} typed-array? obj type +@deffnx {C Function} scm_typed_array_p (obj, type) +Return @code{#t} if the @var{obj} is an array of type +@var{type}, and @code{#f} if not. @end deffn array-rank -@c snarfed from unif.c:328 -@deffn {Scheme Procedure} array-rank ra -@deffnx {C Function} scm_array_rank (ra) -Return the number of dimensions of @var{obj}. If @var{obj} is -not an array, @code{0} is returned. +@c snarfed from unif.c:569 +@deffn {Scheme Procedure} array-rank array +@deffnx {C Function} scm_array_rank (array) +Return the number of dimensions of the array @var{array.} + @end deffn array-dimensions -@c snarfed from unif.c:366 +@c snarfed from unif.c:583 @deffn {Scheme Procedure} array-dimensions ra @deffnx {C Function} scm_array_dimensions (ra) -@code{Array-dimensions} is similar to @code{array-shape} but replaces +@code{array-dimensions} is similar to @code{array-shape} but replaces elements with a @code{0} minimum with one greater than the maximum. So: @lisp (array-dimensions (make-array 'foo '(-1 3) 5)) @result{} ((-1 3) 5) @@ -7526,28 +8871,42 @@ elements with a @code{0} minimum with one greater than the maximum. So: @end deffn shared-array-root -@c snarfed from unif.c:413 +@c snarfed from unif.c:611 @deffn {Scheme Procedure} shared-array-root ra @deffnx {C Function} scm_shared_array_root (ra) Return the root vector of a shared array. @end deffn shared-array-offset -@c snarfed from unif.c:424 +@c snarfed from unif.c:625 @deffn {Scheme Procedure} shared-array-offset ra @deffnx {C Function} scm_shared_array_offset (ra) Return the root vector index of the first element in the array. @end deffn shared-array-increments -@c snarfed from unif.c:435 +@c snarfed from unif.c:641 @deffn {Scheme Procedure} shared-array-increments ra @deffnx {C Function} scm_shared_array_increments (ra) For each dimension, return the distance between elements in the root vector. @end deffn + make-typed-array +@c snarfed from unif.c:740 +@deffn {Scheme Procedure} make-typed-array type fill . bounds +@deffnx {C Function} scm_make_typed_array (type, fill, bounds) +Create and return an array of type @var{type}. +@end deffn + + make-array +@c snarfed from unif.c:775 +@deffn {Scheme Procedure} make-array fill . bounds +@deffnx {C Function} scm_make_array (fill, bounds) +Create and return an array. +@end deffn + dimensions->uniform-array -@c snarfed from unif.c:554 +@c snarfed from unif.c:790 @deffn {Scheme Procedure} dimensions->uniform-array dims prot [fill] @deffnx {Scheme Procedure} make-uniform-vector length prototype [fill] @deffnx {C Function} scm_dimensions_to_uniform_array (dims, prot, fill) @@ -7558,7 +8917,7 @@ fill the array, otherwise @var{prototype} is used. @end deffn make-shared-array -@c snarfed from unif.c:643 +@c snarfed from unif.c:843 @deffn {Scheme Procedure} make-shared-array oldra mapfunc . dims @deffnx {C Function} scm_make_shared_array (oldra, mapfunc, dims) @code{make-shared-array} can be used to create shared subarrays of other @@ -7579,7 +8938,7 @@ it can be otherwise arbitrary. A simple example: @end deffn transpose-array -@c snarfed from unif.c:774 +@c snarfed from unif.c:961 @deffn {Scheme Procedure} transpose-array ra . args @deffnx {C Function} scm_transpose_array (ra, args) Return an array sharing contents with @var{array}, but with @@ -7604,7 +8963,7 @@ have smaller rank than @var{array}. @end deffn enclose-array -@c snarfed from unif.c:879 +@c snarfed from unif.c:1059 @deffn {Scheme Procedure} enclose-array ra . axes @deffnx {C Function} scm_enclose_array (ra, axes) @var{dim0}, @var{dim1} @dots{} should be nonnegative integers less than @@ -7631,7 +8990,7 @@ examples: @end deffn array-in-bounds? -@c snarfed from unif.c:966 +@c snarfed from unif.c:1132 @deffn {Scheme Procedure} array-in-bounds? v . args @deffnx {C Function} scm_array_in_bounds_p (v, args) Return @code{#t} if its arguments would be acceptable to @@ -7639,37 +8998,23 @@ Return @code{#t} if its arguments would be acceptable to @end deffn array-ref -@c snarfed from unif.c:1044 -@deffn {Scheme Procedure} array-ref -implemented by the C function "scm_uniform_vector_ref" -@end deffn - - uniform-vector-ref -@c snarfed from unif.c:1051 -@deffn {Scheme Procedure} uniform-vector-ref v args -@deffnx {Scheme Procedure} array-ref v . args -@deffnx {C Function} scm_uniform_vector_ref (v, args) +@c snarfed from unif.c:1209 +@deffn {Scheme Procedure} array-ref v . args +@deffnx {C Function} scm_array_ref (v, args) Return the element at the @code{(index1, index2)} element in @var{array}. @end deffn - uniform-array-set1! -@c snarfed from unif.c:1219 -@deffn {Scheme Procedure} uniform-array-set1! -implemented by the C function "scm_array_set_x" -@end deffn - array-set! -@c snarfed from unif.c:1228 +@c snarfed from unif.c:1226 @deffn {Scheme Procedure} array-set! v obj . args -@deffnx {Scheme Procedure} uniform-array-set1! v obj args @deffnx {C Function} scm_array_set_x (v, obj, args) Set the element at the @code{(index1, index2)} element in @var{array} to @var{new-value}. The value returned by array-set! is unspecified. @end deffn array-contents -@c snarfed from unif.c:1335 +@c snarfed from unif.c:1252 @deffn {Scheme Procedure} array-contents ra [strict] @deffnx {C Function} scm_array_contents (ra, strict) If @var{array} may be @dfn{unrolled} into a one dimensional shared array @@ -7685,10 +9030,10 @@ memory. @end deffn uniform-array-read! -@c snarfed from unif.c:1449 -@deffn {Scheme Procedure} uniform-array-read! ra [port_or_fd [start [end]]] +@c snarfed from unif.c:1352 +@deffn {Scheme Procedure} uniform-array-read! ura [port_or_fd [start [end]]] @deffnx {Scheme Procedure} uniform-vector-read! uve [port-or-fdes] [start] [end] -@deffnx {C Function} scm_uniform_array_read_x (ra, port_or_fd, start, end) +@deffnx {C Function} scm_uniform_array_read_x (ura, port_or_fd, start, end) Attempt 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, @@ -7706,10 +9051,9 @@ returned by @code{(current-input-port)}. @end deffn uniform-array-write -@c snarfed from unif.c:1632 -@deffn {Scheme Procedure} uniform-array-write v [port_or_fd [start [end]]] -@deffnx {Scheme Procedure} uniform-vector-write uve [port-or-fdes] [start] [end] -@deffnx {C Function} scm_uniform_array_write (v, port_or_fd, start, end) +@c snarfed from unif.c:1406 +@deffn {Scheme Procedure} uniform-array-write ura [port_or_fd [start [end]]] +@deffnx {C Function} scm_uniform_array_write (ura, port_or_fd, start, end) Writes all elements of @var{ura} as binary objects to @var{port-or-fdes}. @@ -7723,8 +9067,78 @@ omitted, in which case it defaults to the value returned by @code{(current-output-port)}. @end deffn + bitvector? +@c snarfed from unif.c:1518 +@deffn {Scheme Procedure} bitvector? obj +@deffnx {C Function} scm_bitvector_p (obj) +Return @code{#t} when @var{obj} is a bitvector, else +return @code{#f}. +@end deffn + + make-bitvector +@c snarfed from unif.c:1545 +@deffn {Scheme Procedure} make-bitvector len [fill] +@deffnx {C Function} scm_make_bitvector (len, fill) +Create a new bitvector of length @var{len} and +optionally initialize all elements to @var{fill}. +@end deffn + + bitvector +@c snarfed from unif.c:1554 +@deffn {Scheme Procedure} bitvector . bits +@deffnx {C Function} scm_bitvector (bits) +Create a new bitvector with the arguments as elements. +@end deffn + + bitvector-length +@c snarfed from unif.c:1570 +@deffn {Scheme Procedure} bitvector-length vec +@deffnx {C Function} scm_bitvector_length (vec) +Return the length of the bitvector @var{vec}. +@end deffn + + bitvector-ref +@c snarfed from unif.c:1661 +@deffn {Scheme Procedure} bitvector-ref vec idx +@deffnx {C Function} scm_bitvector_ref (vec, idx) +Return the element at index @var{idx} of the bitvector +@var{vec}. +@end deffn + + bitvector-set! +@c snarfed from unif.c:1704 +@deffn {Scheme Procedure} bitvector-set! vec idx val +@deffnx {C Function} scm_bitvector_set_x (vec, idx, val) +Set the element at index @var{idx} of the bitvector +@var{vec} when @var{val} is true, else clear it. +@end deffn + + bitvector-fill! +@c snarfed from unif.c:1715 +@deffn {Scheme Procedure} bitvector-fill! vec val +@deffnx {C Function} scm_bitvector_fill_x (vec, val) +Set all elements of the bitvector +@var{vec} when @var{val} is true, else clear them. +@end deffn + + list->bitvector +@c snarfed from unif.c:1760 +@deffn {Scheme Procedure} list->bitvector list +@deffnx {C Function} scm_list_to_bitvector (list) +Return a new bitvector initialized with the elements +of @var{list}. +@end deffn + + bitvector->list +@c snarfed from unif.c:1790 +@deffn {Scheme Procedure} bitvector->list vec +@deffnx {C Function} scm_bitvector_to_list (vec) +Return a new list initialized with the elements +of the bitvector @var{vec}. +@end deffn + bit-count -@c snarfed from unif.c:1759 +@c snarfed from unif.c:1854 @deffn {Scheme Procedure} bit-count b bitvector @deffnx {C Function} scm_bit_count (b, bitvector) Return the number of occurrences of the boolean @var{b} in @@ -7732,7 +9146,7 @@ Return the number of occurrences of the boolean @var{b} in @end deffn bit-position -@c snarfed from unif.c:1804 +@c snarfed from unif.c:1923 @deffn {Scheme Procedure} bit-position item v k @deffnx {C Function} scm_bit_position (item, v, k) Return the index of the first occurrance of @var{item} in bit @@ -7747,7 +9161,7 @@ vector @var{v}, starting from @var{k}. If there is no @end deffn bit-set*! -@c snarfed from unif.c:1890 +@c snarfed from unif.c:2006 @deffn {Scheme Procedure} bit-set*! v kv obj @deffnx {C Function} scm_bit_set_star_x (v, kv, obj) Set entries of bit vector @var{v} to @var{obj}, with @var{kv} @@ -7767,19 +9181,19 @@ bv @result{} #*11010011 @end example -If @var{kv} is a uniform vector of unsigned long integers, then -they're indexes into @var{v} which are set to @var{obj}. +If @var{kv} is a u32vector, then its elements are +indices into @var{v} which are set to @var{obj}. @example (define bv #*01000010) -(bit-set*! bv #u(5 2 7) #t) +(bit-set*! bv #u32(5 2 7) #t) bv @result{} #*01100111 @end example @end deffn bit-count* -@c snarfed from unif.c:1956 +@c snarfed from unif.c:2109 @deffn {Scheme Procedure} bit-count* v kv obj @deffnx {C Function} scm_bit_count_star (v, kv, obj) Return a count of how many entries in bit vector @var{v} are @@ -7790,19 +9204,19 @@ If @var{kv} is a bit vector, then those entries where it has @code{#t} are the ones in @var{v} which are considered. @var{kv} and @var{v} must be the same length. -If @var{kv} is a uniform vector of unsigned long integers, then -it's the indexes in @var{v} to consider. +If @var{kv} is a u32vector, then it contains +the indexes in @var{v} to consider. For example, @example (bit-count* #*01110111 #*11001101 #t) @result{} 3 -(bit-count* #*01110111 #u(7 0 4) #f) @result{} 2 +(bit-count* #*01110111 #u32(7 0 4) #f) @result{} 2 @end example @end deffn bit-invert! -@c snarfed from unif.c:2021 +@c snarfed from unif.c:2196 @deffn {Scheme Procedure} bit-invert! v @deffnx {C Function} scm_bit_invert_x (v) Modify the bit vector @var{v} by replacing each element with @@ -7810,26 +9224,64 @@ its negation. @end deffn array->list -@c snarfed from unif.c:2103 +@c snarfed from unif.c:2303 @deffn {Scheme Procedure} array->list v @deffnx {C Function} scm_array_to_list (v) Return a list consisting of all the elements, in order, of @var{array}. @end deffn + list->typed-array +@c snarfed from unif.c:2332 +@deffn {Scheme Procedure} list->typed-array type shape lst +@deffnx {C Function} scm_list_to_typed_array (type, shape, lst) +Return an array of the type @var{type} +with elements the same as those of @var{lst}. + +The argument @var{shape} determines the number of dimensions +of the array and their shape. It is either an exact integer, +giving the +number of dimensions directly, or a list whose length +specifies the number of dimensions and each element specified +the lower and optionally the upper bound of the corresponding +dimension. +When the element is list of two elements, these elements +give the lower and upper bounds. When it is an exact +integer, it gives only the lower bound. +@end deffn + + list->array +@c snarfed from unif.c:2390 +@deffn {Scheme Procedure} list->array ndim lst +@deffnx {C Function} scm_list_to_array (ndim, lst) +Return an array with elements the same as those of @var{lst}. +@end deffn + list->uniform-array -@c snarfed from unif.c:2205 +@c snarfed from unif.c:2440 @deffn {Scheme Procedure} list->uniform-array ndim prot lst -@deffnx {Scheme Procedure} list->uniform-vector prot lst @deffnx {C Function} scm_list_to_uniform_array (ndim, prot, lst) Return 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. + +The argument @var{ndim} determines the number of dimensions +of the array. It is either an exact integer, giving the +number directly, or a list of exact integers, whose length +specifies the number of dimensions and each element is the +lower index bound of its dimension. +@end deffn + + array-type +@c snarfed from unif.c:2789 +@deffn {Scheme Procedure} array-type ra +@deffnx {C Function} scm_array_type (ra) + @end deffn array-prototype -@c snarfed from unif.c:2562 +@c snarfed from unif.c:2809 @deffn {Scheme Procedure} array-prototype ra @deffnx {C Function} scm_array_prototype (ra) Return an object that would produce an array of the same type @@ -7837,8 +9289,102 @@ as @var{array}, if used as the @var{prototype} for @code{make-uniform-array}. @end deffn + dynamic-link +@c snarfed from dynl.c:149 +@deffn {Scheme Procedure} dynamic-link filename +@deffnx {C Function} scm_dynamic_link (filename) +Find the shared object (shared library) denoted by +@var{filename} and link it into the running Guile +application. The returned +scheme object is a ``handle'' for the library which can +be passed to @code{dynamic-func}, @code{dynamic-call} etc. + +Searching for object files is system dependent. Normally, +if @var{filename} does have an explicit directory it will +be searched for in locations +such as @file{/usr/lib} and @file{/usr/local/lib}. +@end deffn + + dynamic-object? +@c snarfed from dynl.c:168 +@deffn {Scheme Procedure} dynamic-object? obj +@deffnx {C Function} scm_dynamic_object_p (obj) +Return @code{#t} if @var{obj} is a dynamic object handle, +or @code{#f} otherwise. +@end deffn + + dynamic-unlink +@c snarfed from dynl.c:182 +@deffn {Scheme Procedure} dynamic-unlink dobj +@deffnx {C Function} scm_dynamic_unlink (dobj) +Unlink a dynamic object from the application, if possible. The +object must have been linked by @code{dynamic-link}, with +@var{dobj} the corresponding handle. After this procedure +is called, the handle can no longer be used to access the +object. +@end deffn + + dynamic-func +@c snarfed from dynl.c:207 +@deffn {Scheme Procedure} dynamic-func name dobj +@deffnx {C Function} scm_dynamic_func (name, dobj) +Return a ``handle'' for the function @var{name} in the +shared object referred to by @var{dobj}. The handle +can be passed to @code{dynamic-call} to actually +call the function. + +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{name} +since it will be added automatically when necessary. +@end deffn + + dynamic-call +@c snarfed from dynl.c:253 +@deffn {Scheme Procedure} dynamic-call func dobj +@deffnx {C Function} scm_dynamic_call (func, dobj) +Call a C function in a dynamic object. Two styles of +invocation are supported: + +@itemize @bullet +@item @var{func} can be a function handle returned by +@code{dynamic-func}. In this case @var{dobj} is +ignored +@item @var{func} can be a string with the name of the +function to call, with @var{dobj} the handle of the +dynamic object in which to find the function. +This is equivalent to +@smallexample + +(dynamic-call (dynamic-func @var{func} @var{dobj}) #f) +@end smallexample +@end itemize + +In either case, the function is passed no arguments +and its return value is ignored. +@end deffn + + dynamic-args-call +@c snarfed from dynl.c:285 +@deffn {Scheme Procedure} dynamic-args-call func dobj args +@deffnx {C Function} scm_dynamic_args_call (func, dobj, args) +Call the C function indicated by @var{func} and @var{dobj}, +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}. +@end deffn + chown -@c snarfed from filesys.c:220 +@c snarfed from filesys.c:224 @deffn {Scheme Procedure} chown object owner group @deffnx {C Function} scm_chown (object, owner, group) Change the ownership and group of the file referred to by @var{object} to @@ -7856,7 +9402,7 @@ as @code{-1}, then that ID is not changed. @end deffn chmod -@c snarfed from filesys.c:258 +@c snarfed from filesys.c:262 @deffn {Scheme Procedure} chmod object mode @deffnx {C Function} scm_chmod (object, mode) Changes the permissions of the file referred to by @var{obj}. @@ -7869,7 +9415,7 @@ The return value is unspecified. @end deffn umask -@c snarfed from filesys.c:290 +@c snarfed from filesys.c:294 @deffn {Scheme Procedure} umask [mode] @deffnx {C Function} scm_umask (mode) If @var{mode} is omitted, returns a decimal number representing the current @@ -7880,7 +9426,7 @@ E.g., @code{(umask #o022)} sets the mask to octal 22, decimal 18. @end deffn open-fdes -@c snarfed from filesys.c:312 +@c snarfed from filesys.c:316 @deffn {Scheme Procedure} open-fdes path flags [mode] @deffnx {C Function} scm_open_fdes (path, flags, mode) Similar to @code{open} but return a file descriptor instead of @@ -7888,7 +9434,7 @@ a port. @end deffn open -@c snarfed from filesys.c:353 +@c snarfed from filesys.c:357 @deffn {Scheme Procedure} open path flags [mode] @deffnx {C Function} scm_open (path, flags, mode) Open the file named by @var{path} for reading and/or writing. @@ -7921,7 +9467,7 @@ for additional flags. @end deffn close -@c snarfed from filesys.c:391 +@c snarfed from filesys.c:395 @deffn {Scheme Procedure} close fd_or_port @deffnx {C Function} scm_close (fd_or_port) Similar to close-port (@pxref{Closing, close-port}), @@ -7932,7 +9478,7 @@ their revealed counts set to zero. @end deffn close-fdes -@c snarfed from filesys.c:418 +@c snarfed from filesys.c:422 @deffn {Scheme Procedure} close-fdes fd @deffnx {C Function} scm_close_fdes (fd) A simple wrapper for the @code{close} system call. @@ -7943,7 +9489,7 @@ The return value is unspecified. @end deffn stat -@c snarfed from filesys.c:620 +@c snarfed from filesys.c:624 @deffn {Scheme Procedure} stat object @deffnx {C Function} scm_stat (object) Return an object containing various information about the file @@ -8005,7 +9551,7 @@ An integer representing the access permission bits. @end deffn link -@c snarfed from filesys.c:682 +@c snarfed from filesys.c:686 @deffn {Scheme Procedure} link oldpath newpath @deffnx {C Function} scm_link (oldpath, newpath) Creates a new name @var{newpath} in the file system for the @@ -8015,7 +9561,7 @@ system. @end deffn rename-file -@c snarfed from filesys.c:720 +@c snarfed from filesys.c:724 @deffn {Scheme Procedure} rename-file oldname newname @deffnx {C Function} scm_rename (oldname, newname) Renames the file specified by @var{oldname} to @var{newname}. @@ -8023,14 +9569,14 @@ The return value is unspecified. @end deffn delete-file -@c snarfed from filesys.c:737 +@c snarfed from filesys.c:741 @deffn {Scheme Procedure} delete-file str @deffnx {C Function} scm_delete_file (str) Deletes (or "unlinks") the file specified by @var{path}. @end deffn mkdir -@c snarfed from filesys.c:754 +@c snarfed from filesys.c:758 @deffn {Scheme Procedure} mkdir path [mode] @deffnx {C Function} scm_mkdir (path, mode) Create a new directory named by @var{path}. If @var{mode} is omitted @@ -8040,7 +9586,7 @@ umask. Otherwise they are set to the decimal value specified with @end deffn rmdir -@c snarfed from filesys.c:781 +@c snarfed from filesys.c:785 @deffn {Scheme Procedure} rmdir path @deffnx {C Function} scm_rmdir (path) Remove the existing directory named by @var{path}. The directory must @@ -8048,7 +9594,7 @@ be empty for this to succeed. The return value is unspecified. @end deffn directory-stream? -@c snarfed from filesys.c:805 +@c snarfed from filesys.c:809 @deffn {Scheme Procedure} directory-stream? obj @deffnx {C Function} scm_directory_stream_p (obj) Return a boolean indicating whether @var{object} is a directory @@ -8056,7 +9602,7 @@ stream as returned by @code{opendir}. @end deffn opendir -@c snarfed from filesys.c:816 +@c snarfed from filesys.c:820 @deffn {Scheme Procedure} opendir dirname @deffnx {C Function} scm_opendir (dirname) Open the directory specified by @var{path} and return a directory @@ -8064,7 +9610,7 @@ stream. @end deffn readdir -@c snarfed from filesys.c:837 +@c snarfed from filesys.c:841 @deffn {Scheme Procedure} readdir port @deffnx {C Function} scm_readdir (port) Return (as a string) the next directory entry from the directory stream @@ -8073,7 +9619,7 @@ end of file object is returned. @end deffn rewinddir -@c snarfed from filesys.c:876 +@c snarfed from filesys.c:880 @deffn {Scheme Procedure} rewinddir port @deffnx {C Function} scm_rewinddir (port) Reset the directory port @var{stream} so that the next call to @@ -8081,7 +9627,7 @@ Reset the directory port @var{stream} so that the next call to @end deffn closedir -@c snarfed from filesys.c:893 +@c snarfed from filesys.c:897 @deffn {Scheme Procedure} closedir port @deffnx {C Function} scm_closedir (port) Close the directory stream @var{stream}. @@ -8089,7 +9635,7 @@ The return value is unspecified. @end deffn chdir -@c snarfed from filesys.c:943 +@c snarfed from filesys.c:947 @deffn {Scheme Procedure} chdir str @deffnx {C Function} scm_chdir (str) Change the current working directory to @var{path}. @@ -8097,14 +9643,14 @@ The return value is unspecified. @end deffn getcwd -@c snarfed from filesys.c:958 +@c snarfed from filesys.c:962 @deffn {Scheme Procedure} getcwd @deffnx {C Function} scm_getcwd () Return the name of the current working directory. @end deffn select -@c snarfed from filesys.c:1159 +@c snarfed from filesys.c:1164 @deffn {Scheme Procedure} select reads writes excepts [secs [usecs]] @deffnx {C Function} scm_select (reads, writes, excepts, secs, usecs) This procedure has a variety of uses: waiting for the ability @@ -8139,7 +9685,7 @@ An additional @code{select!} interface is provided. @end deffn fcntl -@c snarfed from filesys.c:1297 +@c snarfed from filesys.c:1302 @deffn {Scheme Procedure} fcntl object cmd [value] @deffnx {C Function} scm_fcntl (object, cmd, value) Apply @var{command} to the specified file descriptor or the underlying @@ -8170,7 +9716,7 @@ The value used to indicate the "close on exec" flag with @code{F_GETFL} or @end deffn fsync -@c snarfed from filesys.c:1329 +@c snarfed from filesys.c:1334 @deffn {Scheme Procedure} fsync object @deffnx {C Function} scm_fsync (object) Copies any unwritten data for the specified output file descriptor to disk. @@ -8180,7 +9726,7 @@ The return value is unspecified. @end deffn symlink -@c snarfed from filesys.c:1354 +@c snarfed from filesys.c:1359 @deffn {Scheme Procedure} symlink oldpath newpath @deffnx {C Function} scm_symlink (oldpath, newpath) Create a symbolic link named @var{path-to} with the value (i.e., pointing to) @@ -8188,7 +9734,7 @@ Create a symbolic link named @var{path-to} with the value (i.e., pointing to) @end deffn readlink -@c snarfed from filesys.c:1373 +@c snarfed from filesys.c:1378 @deffn {Scheme Procedure} readlink path @deffnx {C Function} scm_readlink (path) Return the value of the symbolic link named by @var{path} (a @@ -8196,7 +9742,7 @@ string), i.e., the file that the link points to. @end deffn lstat -@c snarfed from filesys.c:1415 +@c snarfed from filesys.c:1420 @deffn {Scheme Procedure} lstat str @deffnx {C Function} scm_lstat (str) Similar to @code{stat}, but does not follow symbolic links, i.e., @@ -8205,7 +9751,7 @@ file it points to. @var{path} must be a string. @end deffn copy-file -@c snarfed from filesys.c:1438 +@c snarfed from filesys.c:1443 @deffn {Scheme Procedure} copy-file oldfile newfile @deffnx {C Function} scm_copy_file (oldfile, newfile) Copy the file specified by @var{path-from} to @var{path-to}. @@ -8213,7 +9759,7 @@ The return value is unspecified. @end deffn dirname -@c snarfed from filesys.c:1501 +@c snarfed from filesys.c:1506 @deffn {Scheme Procedure} dirname filename @deffnx {C Function} scm_dirname (filename) Return the directory name component of the file name @@ -8222,7 +9768,7 @@ component, @code{.} is returned. @end deffn basename -@c snarfed from filesys.c:1544 +@c snarfed from filesys.c:1549 @deffn {Scheme Procedure} basename filename [suffix] @deffnx {C Function} scm_basename (filename, suffix) Return the base name of the file name @var{filename}. The @@ -8232,7 +9778,7 @@ If @var{suffix} is provided, and is equal to the end of @end deffn pipe -@c snarfed from posix.c:231 +@c snarfed from posix.c:233 @deffn {Scheme Procedure} pipe @deffnx {C Function} scm_pipe () Return a newly created pipe: a pair of ports which are linked @@ -8251,7 +9797,7 @@ from the input port. @end deffn getgroups -@c snarfed from posix.c:252 +@c snarfed from posix.c:254 @deffn {Scheme Procedure} getgroups @deffnx {C Function} scm_getgroups () Return a vector of integers representing the current @@ -8259,7 +9805,7 @@ supplementary group IDs. @end deffn setgroups -@c snarfed from posix.c:285 +@c snarfed from posix.c:287 @deffn {Scheme Procedure} setgroups group_vec @deffnx {C Function} scm_setgroups (group_vec) Set the current set of supplementary group IDs to the integers @@ -8270,7 +9816,7 @@ Generally only the superuser can set the process group IDs. @end deffn getpw -@c snarfed from posix.c:333 +@c snarfed from posix.c:336 @deffn {Scheme Procedure} getpw [user] @deffnx {C Function} scm_getpwuid (user) Look up an entry in the user database. @var{obj} can be an integer, @@ -8279,7 +9825,7 @@ or getpwent respectively. @end deffn setpw -@c snarfed from posix.c:383 +@c snarfed from posix.c:386 @deffn {Scheme Procedure} setpw [arg] @deffnx {C Function} scm_setpwent (arg) If called with a true argument, initialize or reset the password data @@ -8288,7 +9834,7 @@ stream. Otherwise, close the stream. The @code{setpwent} and @end deffn getgr -@c snarfed from posix.c:402 +@c snarfed from posix.c:405 @deffn {Scheme Procedure} getgr [name] @deffnx {C Function} scm_getgrgid (name) Look up an entry in the group database. @var{obj} can be an integer, @@ -8297,7 +9843,7 @@ or getgrent respectively. @end deffn setgr -@c snarfed from posix.c:438 +@c snarfed from posix.c:441 @deffn {Scheme Procedure} setgr [arg] @deffnx {C Function} scm_setgrent (arg) If called with a true argument, initialize or reset the group data @@ -8306,7 +9852,7 @@ stream. Otherwise, close the stream. The @code{setgrent} and @end deffn kill -@c snarfed from posix.c:474 +@c snarfed from posix.c:477 @deffn {Scheme Procedure} kill pid sig @deffnx {C Function} scm_kill (pid, sig) Sends a signal to the specified process or group of processes. @@ -8339,7 +9885,7 @@ Interrupt signal. @end deffn waitpid -@c snarfed from posix.c:525 +@c snarfed from posix.c:528 @deffn {Scheme Procedure} waitpid pid [options] @deffnx {C Function} scm_waitpid (pid, options) This procedure collects status information from a child process which @@ -8386,7 +9932,7 @@ The integer status value. @end deffn status:exit-val -@c snarfed from posix.c:551 +@c snarfed from posix.c:554 @deffn {Scheme Procedure} status:exit-val status @deffnx {C Function} scm_status_exit_val (status) Return the exit status value, as would be set if a process @@ -8395,7 +9941,7 @@ if any, otherwise @code{#f}. @end deffn status:term-sig -@c snarfed from posix.c:569 +@c snarfed from posix.c:572 @deffn {Scheme Procedure} status:term-sig status @deffnx {C Function} scm_status_term_sig (status) Return the signal number which terminated the process, if any, @@ -8403,7 +9949,7 @@ otherwise @code{#f}. @end deffn status:stop-sig -@c snarfed from posix.c:585 +@c snarfed from posix.c:588 @deffn {Scheme Procedure} status:stop-sig status @deffnx {C Function} scm_status_stop_sig (status) Return the signal number which stopped the process, if any, @@ -8411,7 +9957,7 @@ otherwise @code{#f}. @end deffn getppid -@c snarfed from posix.c:603 +@c snarfed from posix.c:606 @deffn {Scheme Procedure} getppid @deffnx {C Function} scm_getppid () Return an integer representing the process ID of the parent @@ -8419,21 +9965,21 @@ process. @end deffn getuid -@c snarfed from posix.c:615 +@c snarfed from posix.c:618 @deffn {Scheme Procedure} getuid @deffnx {C Function} scm_getuid () Return an integer representing the current real user ID. @end deffn getgid -@c snarfed from posix.c:626 +@c snarfed from posix.c:629 @deffn {Scheme Procedure} getgid @deffnx {C Function} scm_getgid () Return an integer representing the current real group ID. @end deffn geteuid -@c snarfed from posix.c:640 +@c snarfed from posix.c:643 @deffn {Scheme Procedure} geteuid @deffnx {C Function} scm_geteuid () Return an integer representing the current effective user ID. @@ -8443,7 +9989,7 @@ system supports effective IDs. @end deffn getegid -@c snarfed from posix.c:657 +@c snarfed from posix.c:660 @deffn {Scheme Procedure} getegid @deffnx {C Function} scm_getegid () Return an integer representing the current effective group ID. @@ -8453,7 +9999,7 @@ system supports effective IDs. @end deffn setuid -@c snarfed from posix.c:673 +@c snarfed from posix.c:676 @deffn {Scheme Procedure} setuid id @deffnx {C Function} scm_setuid (id) Sets both the real and effective user IDs to the integer @var{id}, provided @@ -8462,7 +10008,7 @@ The return value is unspecified. @end deffn setgid -@c snarfed from posix.c:686 +@c snarfed from posix.c:689 @deffn {Scheme Procedure} setgid id @deffnx {C Function} scm_setgid (id) Sets both the real and effective group IDs to the integer @var{id}, provided @@ -8471,7 +10017,7 @@ The return value is unspecified. @end deffn seteuid -@c snarfed from posix.c:701 +@c snarfed from posix.c:704 @deffn {Scheme Procedure} seteuid id @deffnx {C Function} scm_seteuid (id) Sets the effective user ID to the integer @var{id}, provided the process @@ -8482,7 +10028,7 @@ The return value is unspecified. @end deffn setegid -@c snarfed from posix.c:726 +@c snarfed from posix.c:729 @deffn {Scheme Procedure} setegid id @deffnx {C Function} scm_setegid (id) Sets the effective group ID to the integer @var{id}, provided the process @@ -8493,7 +10039,7 @@ The return value is unspecified. @end deffn getpgrp -@c snarfed from posix.c:749 +@c snarfed from posix.c:752 @deffn {Scheme Procedure} getpgrp @deffnx {C Function} scm_getpgrp () Return an integer representing the current process group ID. @@ -8501,7 +10047,7 @@ This is the POSIX definition, not BSD. @end deffn setpgid -@c snarfed from posix.c:767 +@c snarfed from posix.c:770 @deffn {Scheme Procedure} setpgid pid pgid @deffnx {C Function} scm_setpgid (pid, pgid) Move the process @var{pid} into the process group @var{pgid}. @var{pid} or @@ -8512,7 +10058,7 @@ The return value is unspecified. @end deffn setsid -@c snarfed from posix.c:784 +@c snarfed from posix.c:787 @deffn {Scheme Procedure} setsid @deffnx {C Function} scm_setsid () Creates a new session. The current process becomes the session leader @@ -8522,7 +10068,7 @@ The return value is an integer representing the new process group ID. @end deffn ttyname -@c snarfed from posix.c:808 +@c snarfed from posix.c:811 @deffn {Scheme Procedure} ttyname port @deffnx {C Function} scm_ttyname (port) Return a string with the name of the serial terminal device @@ -8530,7 +10076,7 @@ underlying @var{port}. @end deffn ctermid -@c snarfed from posix.c:847 +@c snarfed from posix.c:850 @deffn {Scheme Procedure} ctermid @deffnx {C Function} scm_ctermid () Return a string containing the file name of the controlling @@ -8538,7 +10084,7 @@ terminal for the current process. @end deffn tcgetpgrp -@c snarfed from posix.c:871 +@c snarfed from posix.c:874 @deffn {Scheme Procedure} tcgetpgrp port @deffnx {C Function} scm_tcgetpgrp (port) Return the process group ID of the foreground process group @@ -8554,7 +10100,7 @@ foreground. @end deffn tcsetpgrp -@c snarfed from posix.c:895 +@c snarfed from posix.c:898 @deffn {Scheme Procedure} tcsetpgrp port pgid @deffnx {C Function} scm_tcsetpgrp (port, pgid) Set the foreground process group ID for the terminal used by the file @@ -8565,7 +10111,7 @@ controlling terminal. The return value is unspecified. @end deffn execl -@c snarfed from posix.c:927 +@c snarfed from posix.c:930 @deffn {Scheme Procedure} execl filename . args @deffnx {C Function} scm_execl (filename, args) Executes the file named by @var{path} as a new process image. @@ -8582,7 +10128,7 @@ call, but we call it @code{execl} because of its Scheme calling interface. @end deffn execlp -@c snarfed from posix.c:958 +@c snarfed from posix.c:961 @deffn {Scheme Procedure} execlp filename . args @deffnx {C Function} scm_execlp (filename, args) Similar to @code{execl}, however if @@ -8595,7 +10141,7 @@ call, but we call it @code{execlp} because of its Scheme calling interface. @end deffn execle -@c snarfed from posix.c:992 +@c snarfed from posix.c:995 @deffn {Scheme Procedure} execle filename env . args @deffnx {C Function} scm_execle (filename, env, args) Similar to @code{execl}, but the environment of the new process is @@ -8607,7 +10153,7 @@ call, but we call it @code{execle} because of its Scheme calling interface. @end deffn primitive-fork -@c snarfed from posix.c:1028 +@c snarfed from posix.c:1031 @deffn {Scheme Procedure} primitive-fork @deffnx {C Function} scm_fork () Creates a new "child" process by duplicating the current "parent" process. @@ -8619,7 +10165,7 @@ with the scsh fork. @end deffn uname -@c snarfed from posix.c:1048 +@c snarfed from posix.c:1051 @deffn {Scheme Procedure} uname @deffnx {C Function} scm_uname () Return an object with some information about the computer @@ -8627,7 +10173,7 @@ system the program is running on. @end deffn environ -@c snarfed from posix.c:1077 +@c snarfed from posix.c:1080 @deffn {Scheme Procedure} environ [env] @deffnx {C Function} scm_environ (env) If @var{env} is omitted, return the current environment (in the @@ -8640,7 +10186,7 @@ then the return value is unspecified. @end deffn tmpnam -@c snarfed from posix.c:1110 +@c snarfed from posix.c:1113 @deffn {Scheme Procedure} tmpnam @deffnx {C Function} scm_tmpnam () Return a name in the file system that does not match any @@ -8651,18 +10197,23 @@ Care should be taken if opening the file, e.g., use the @end deffn mkstemp! -@c snarfed from posix.c:1136 +@c snarfed from posix.c:1144 @deffn {Scheme Procedure} mkstemp! tmpl @deffnx {C Function} scm_mkstemp (tmpl) Create a new unique file in the file system and returns a new buffered port open for reading and writing to the file. + @var{tmpl} is a string specifying where the file should be -created: it must end with @code{XXXXXX} and will be changed in +created: it must end with @samp{XXXXXX} and will be changed in place to return the name of the temporary file. + +The file is created with mode @code{0600}, which means read and +write for the owner only. @code{chmod} can be used to change +this. @end deffn utime -@c snarfed from posix.c:1171 +@c snarfed from posix.c:1179 @deffn {Scheme Procedure} utime pathname [actime [modtime]] @deffnx {C Function} scm_utime (pathname, actime, modtime) @code{utime} sets the access and modification times for the @@ -8678,43 +10229,60 @@ modification time to the current time. @end deffn access? -@c snarfed from posix.c:1219 +@c snarfed from posix.c:1244 @deffn {Scheme Procedure} access? path how @deffnx {C Function} scm_access (path, how) -Return @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. +Test accessibility of a file under the real UID and GID of the +calling process. The return is @code{#t} if @var{path} exists +and the permissions requested by @var{how} are all allowed, or +@code{#f} if not. -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. +@var{how} is an integer which is one of the following values, +or a bitwise-OR (@code{logior}) of multiple values. @defvar R_OK -test for read permission. +Test for read permission. @end defvar @defvar W_OK -test for write permission. +Test for write permission. @end defvar @defvar X_OK -test for execute permission. +Test for execute permission. @end defvar @defvar F_OK -test for existence of the file. +Test for existence of the file. This is implied by each of the +other tests, so there's no need to combine it with them. @end defvar + +It's important to note that @code{access?} does not simply +indicate what will happen on attempting to read or write a +file. In normal circumstances it does, but in a set-UID or +set-GID program it doesn't because @code{access?} tests the +real ID, whereas an open or execute attempt uses the effective +ID. + +A program which will never run set-UID/GID can ignore the +difference between real and effective IDs, but for maximum +generality, especially in library functions, it's best not to +use @code{access?} to predict the result of an open or execute, +instead simply attempt that and catch any exception. + +The main use for @code{access?} is to let a set-UID/GID program +determine what the invoking user would have been allowed to do, +without the greater (or perhaps lesser) privileges afforded by +the effective ID. For more on this, see ``Testing File +Access'' in The GNU C Library Reference Manual. @end deffn getpid -@c snarfed from posix.c:1232 +@c snarfed from posix.c:1257 @deffn {Scheme Procedure} getpid @deffnx {C Function} scm_getpid () Return an integer representing the current process ID. @end deffn putenv -@c snarfed from posix.c:1249 +@c snarfed from posix.c:1274 @deffn {Scheme Procedure} putenv str @deffnx {C Function} scm_putenv (str) Modifies the environment of the current process, which is @@ -8731,7 +10299,7 @@ The return value is unspecified. @end deffn setlocale -@c snarfed from posix.c:1333 +@c snarfed from posix.c:1358 @deffn {Scheme Procedure} setlocale category [locale] @deffnx {C Function} scm_setlocale (category, locale) If @var{locale} is omitted, return the current value of the @@ -8746,7 +10314,7 @@ the locale will be set using environment variables. @end deffn mknod -@c snarfed from posix.c:1376 +@c snarfed from posix.c:1407 @deffn {Scheme Procedure} mknod path type perms dev @deffnx {C Function} scm_mknod (path, type, perms, dev) Creates a new special file, such as a file corresponding to a device. @@ -8767,7 +10335,7 @@ The return value is unspecified. @end deffn nice -@c snarfed from posix.c:1422 +@c snarfed from posix.c:1453 @deffn {Scheme Procedure} nice incr @deffnx {C Function} scm_nice (incr) Increment the priority of the current process by @var{incr}. A higher @@ -8776,7 +10344,7 @@ The return value is unspecified. @end deffn sync -@c snarfed from posix.c:1436 +@c snarfed from posix.c:1471 @deffn {Scheme Procedure} sync @deffnx {C Function} scm_sync () Flush the operating system disk buffers. @@ -8784,7 +10352,7 @@ The return value is unspecified. @end deffn crypt -@c snarfed from posix.c:1467 +@c snarfed from posix.c:1502 @deffn {Scheme Procedure} crypt key salt @deffnx {C Function} scm_crypt (key, salt) Encrypt @var{key} using @var{salt} as the salt value to the @@ -8792,7 +10360,7 @@ crypt(3) library call. @end deffn chroot -@c snarfed from posix.c:1499 +@c snarfed from posix.c:1531 @deffn {Scheme Procedure} chroot path @deffnx {C Function} scm_chroot (path) Change the root directory to that specified in @var{path}. @@ -8803,7 +10371,7 @@ root directory. @end deffn getlogin -@c snarfed from posix.c:1533 +@c snarfed from posix.c:1565 @deffn {Scheme Procedure} getlogin @deffnx {C Function} scm_getlogin () Return a string containing the name of the user logged in on @@ -8812,7 +10380,7 @@ information cannot be obtained. @end deffn cuserid -@c snarfed from posix.c:1551 +@c snarfed from posix.c:1583 @deffn {Scheme Procedure} cuserid @deffnx {C Function} scm_cuserid () Return a string containing a user name associated with the @@ -8821,7 +10389,7 @@ information cannot be obtained. @end deffn getpriority -@c snarfed from posix.c:1577 +@c snarfed from posix.c:1609 @deffn {Scheme Procedure} getpriority which who @deffnx {C Function} scm_getpriority (which, who) Return the scheduling priority of the process, process group @@ -8837,7 +10405,7 @@ specified processes. @end deffn setpriority -@c snarfed from posix.c:1611 +@c snarfed from posix.c:1643 @deffn {Scheme Procedure} setpriority which who prio @deffnx {C Function} scm_setpriority (which, who, prio) Set the scheduling priority of the process, process group @@ -8856,7 +10424,7 @@ The return value is not specified. @end deffn getpass -@c snarfed from posix.c:1636 +@c snarfed from posix.c:1668 @deffn {Scheme Procedure} getpass prompt @deffnx {C Function} scm_getpass (prompt) Display @var{prompt} to the standard error output and read @@ -8869,30 +10437,37 @@ characters is disabled. @end deffn flock -@c snarfed from posix.c:1741 +@c snarfed from posix.c:1780 @deffn {Scheme Procedure} flock file operation @deffnx {C Function} scm_flock (file, operation) Apply or remove an advisory lock on an open file. @var{operation} specifies the action to be done: -@table @code -@item LOCK_SH + +@defvar LOCK_SH Shared lock. More than one process may hold a shared lock for a given file at a given time. -@item LOCK_EX +@end defvar +@defvar LOCK_EX Exclusive lock. Only one process may hold an exclusive lock for a given file at a given time. -@item LOCK_UN +@end defvar +@defvar LOCK_UN Unlock the file. -@item LOCK_NB -Don't block when locking. May be specified by bitwise OR'ing -it to one of the other operations. -@end table +@end defvar +@defvar LOCK_NB +Don't block when locking. This is combined with one of the +other operations using @code{logior}. If @code{flock} would +block an @code{EWOULDBLOCK} error is thrown. +@end defvar + The return value is not specified. @var{file} may be an open file descriptor or an open file descriptor port. + +Note that @code{flock} does not lock files across NFS. @end deffn sethostname -@c snarfed from posix.c:1766 +@c snarfed from posix.c:1805 @deffn {Scheme Procedure} sethostname name @deffnx {C Function} scm_sethostname (name) Set the host name of the current processor to @var{name}. May @@ -8901,7 +10476,7 @@ specified. @end deffn gethostname -@c snarfed from posix.c:1784 +@c snarfed from posix.c:1823 @deffn {Scheme Procedure} gethostname @deffnx {C Function} scm_gethostname () Return the host name of the current processor. @@ -9096,7 +10671,7 @@ Make an IPv4 Internet address by combining the network number @end deffn inet-pton -@c snarfed from socket.c:399 +@c snarfed from socket.c:350 @deffn {Scheme Procedure} inet-pton family address @deffnx {C Function} scm_inet_pton (family, address) Convert a string containing a printable network address to @@ -9112,7 +10687,7 @@ the result is an integer with normal host byte ordering. @end deffn inet-ntop -@c snarfed from socket.c:437 +@c snarfed from socket.c:388 @deffn {Scheme Procedure} inet-ntop family address @deffnx {C Function} scm_inet_ntop (family, address) Convert a network address into a printable string. @@ -9122,13 +10697,13 @@ the input is an integer with normal host byte ordering. @lisp (inet-ntop AF_INET 2130706433) @result{} "127.0.0.1" -(inet-ntop AF_INET6 (- (expt 2 128) 1)) @result{} -ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff +(inet-ntop AF_INET6 (- (expt 2 128) 1)) + @result{} "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" @end lisp @end deffn socket -@c snarfed from socket.c:479 +@c snarfed from socket.c:430 @deffn {Scheme Procedure} socket family style proto @deffnx {C Function} scm_socket (family, style, proto) Return a new socket port of the type specified by @var{family}, @@ -9147,7 +10722,7 @@ has been connected to another socket. @end deffn socketpair -@c snarfed from socket.c:500 +@c snarfed from socket.c:451 @deffn {Scheme Procedure} socketpair family style proto @deffnx {C Function} scm_socketpair (family, style, proto) Return a pair of connected (but unnamed) socket ports of the @@ -9158,7 +10733,7 @@ family. Zero is likely to be the only meaningful value for @end deffn getsockopt -@c snarfed from socket.c:525 +@c snarfed from socket.c:476 @deffn {Scheme Procedure} getsockopt sock level optname @deffnx {C Function} scm_getsockopt (sock, level, optname) Return the value of a particular socket option for the socket @@ -9173,7 +10748,7 @@ returns a pair of integers. @end deffn setsockopt -@c snarfed from socket.c:593 +@c snarfed from socket.c:544 @deffn {Scheme Procedure} setsockopt sock level optname value @deffnx {C Function} scm_setsockopt (sock, level, optname, value) Set the value of a particular socket option for the socket @@ -9190,7 +10765,7 @@ The return value is unspecified. @end deffn shutdown -@c snarfed from socket.c:697 +@c snarfed from socket.c:646 @deffn {Scheme Procedure} shutdown sock how @deffnx {C Function} scm_shutdown (sock, how) Sockets can be closed simply by using @code{close-port}. The @@ -9213,7 +10788,7 @@ The return value is unspecified. @end deffn connect -@c snarfed from socket.c:842 +@c snarfed from socket.c:789 @deffn {Scheme Procedure} connect sock fam address . args @deffnx {C Function} scm_connect (sock, fam, address, args) Initiate a connection from a socket using a specified address @@ -9240,7 +10815,7 @@ The return value is unspecified. @end deffn bind -@c snarfed from socket.c:901 +@c snarfed from socket.c:848 @deffn {Scheme Procedure} bind sock fam address . args @deffnx {C Function} scm_bind (sock, fam, address, args) Assign an address to the socket port @var{sock}. @@ -9289,7 +10864,7 @@ The return value is unspecified. @end deffn listen -@c snarfed from socket.c:934 +@c snarfed from socket.c:881 @deffn {Scheme Procedure} listen sock backlog @deffnx {C Function} scm_listen (sock, backlog) Enable @var{sock} to accept connection @@ -9303,7 +10878,7 @@ The return value is unspecified. @end deffn accept -@c snarfed from socket.c:1046 +@c snarfed from socket.c:993 @deffn {Scheme Procedure} accept sock @deffnx {C Function} scm_accept (sock) Accept a connection on a bound, listening socket. @@ -9323,7 +10898,7 @@ connection and will continue to accept new requests. @end deffn getsockname -@c snarfed from socket.c:1073 +@c snarfed from socket.c:1020 @deffn {Scheme Procedure} getsockname sock @deffnx {C Function} scm_getsockname (sock) Return the address of @var{sock}, in the same form as the @@ -9332,7 +10907,7 @@ of a socket in the @code{AF_FILE} namespace cannot be read. @end deffn getpeername -@c snarfed from socket.c:1095 +@c snarfed from socket.c:1042 @deffn {Scheme Procedure} getpeername sock @deffnx {C Function} scm_getpeername (sock) Return the address that @var{sock} @@ -9342,7 +10917,7 @@ is connected to, in the same form as the object returned by @end deffn recv! -@c snarfed from socket.c:1130 +@c snarfed from socket.c:1077 @deffn {Scheme Procedure} recv! sock buf [flags] @deffnx {C Function} scm_recv (sock, buf, flags) Receive data from a socket port. @@ -9368,7 +10943,7 @@ any unread buffered port data is ignored. @end deffn send -@c snarfed from socket.c:1173 +@c snarfed from socket.c:1120 @deffn {Scheme Procedure} send sock message [flags] @deffnx {C Function} scm_send (sock, message, flags) Transmit the string @var{message} on a socket port @var{sock}. @@ -9387,7 +10962,7 @@ any unflushed buffered port data is ignored. @end deffn recvfrom! -@c snarfed from socket.c:1224 +@c snarfed from socket.c:1171 @deffn {Scheme Procedure} recvfrom! sock str [flags [start [end]]] @deffnx {C Function} scm_recvfrom (sock, str, flags, start, end) Return data from the socket port @var{sock} and also @@ -9416,7 +10991,7 @@ descriptor: any unread buffered port data is ignored. @end deffn sendto -@c snarfed from socket.c:1289 +@c snarfed from socket.c:1236 @deffn {Scheme Procedure} sendto sock message fam address . args_and_flags @deffnx {C Function} scm_sendto (sock, message, fam, address, args_and_flags) Transmit the string @var{message} on the socket port @@ -9440,7 +11015,7 @@ any unflushed buffered port data is ignored. @end deffn regexp? -@c snarfed from regex-posix.c:105 +@c snarfed from regex-posix.c:106 @deffn {Scheme Procedure} regexp? obj @deffnx {C Function} scm_regexp_p (obj) Return @code{#t} if @var{obj} is a compiled regular expression, @@ -9448,7 +11023,7 @@ or @code{#f} otherwise. @end deffn make-regexp -@c snarfed from regex-posix.c:150 +@c snarfed from regex-posix.c:151 @deffn {Scheme Procedure} make-regexp pat . flags @deffnx {C Function} scm_make_regexp (pat, flags) Compile the regular expression described by @var{pat}, and @@ -9491,7 +11066,7 @@ one which comes last will override the earlier one. @end deffn regexp-exec -@c snarfed from regex-posix.c:216 +@c snarfed from regex-posix.c:217 @deffn {Scheme Procedure} regexp-exec rx str [start [flags]] @deffnx {C Function} scm_regexp_exec (rx, str, start, flags) Match the compiled regular expression @var{rx} against