diff options
author | Andy Wingo <wingo@pobox.com> | 2012-07-04 17:48:06 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2012-07-04 17:49:37 +0200 |
commit | e1c80e6b30eb665c74276af377b3861e91a32594 (patch) | |
tree | b49d996e7b1736c65e522b0af39198ff7416864a /doc/ref | |
parent | 467be245cbd8992b69c53b9fafeb2828fe816a0b (diff) | |
download | guile-e1c80e6b30eb665c74276af377b3861e91a32594.tar.gz |
add scm_c_nvalues with docs; also, docs for scm_c_values
* libguile/values.h:
* libguile/values.c (scm_c_nvalues): New function.
* doc/ref/api-control.texi (Multiple Values): Add docs for scm_c_values
and scm_c_nvalues.
Fixes http://bugs.gnu.org/11764.
Diffstat (limited to 'doc/ref')
-rw-r--r-- | doc/ref/api-control.texi | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/doc/ref/api-control.texi b/doc/ref/api-control.texi index ca7ad4af6..95c4925a9 100644 --- a/doc/ref/api-control.texi +++ b/doc/ref/api-control.texi @@ -838,12 +838,27 @@ the current implementation that object shares structure with @var{args}, so @var{args} should not be modified subsequently. @end deffn -@deffn {C Function} scm_c_value_ref (values, idx) +@deftypefn {C Function} SCM scm_c_values (SCM *base, size_t n) +@code{scm_c_values} is an alternative to @code{scm_values}. It creates +a new values object, and copies into it the @var{n} values starting from +@var{base}. + +Currently this creates a list and passes it to @code{scm_values}, but we +expect that in the future we will be able to use more a efficient +representation. +@end deftypefn + +@deftypefn {C Function} size_t scm_c_nvalues (SCM obj) +If @var{obj} is a multiple-values object, returns the number of values +it contains. Otherwise returns 1. +@end deftypefn + +@deftypefn {C Function} SCM scm_c_value_ref (SCM obj, size_t idx) Returns the value at the position specified by @var{idx} in -@var{values}. Note that @var{values} will ordinarily be a +@var{obj}. Note that @var{obj} will ordinarily be a multiple-values object, but it need not be. Any other object represents a single value (itself), and is handled appropriately. -@end deffn +@end deftypefn @rnindex call-with-values @deffn {Scheme Procedure} call-with-values producer consumer |