unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#11764: Missing C API doc for accessing unknown number of values
@ 2012-06-22 15:17 David Kastrup
  2012-07-04 15:52 ` Andy Wingo
  0 siblings, 1 reply; 2+ messages in thread
From: David Kastrup @ 2012-06-22 15:17 UTC (permalink / raw)
  To: 11764


<URL:http://www.gnu.org/software/guile/manual/html_node/Multiple-Values.html#Multiple-Values>

provides scm_c_value_ref for accessing a particular value from a values
object.  There is no documented way for figuring out how many values
there are.  There is no documented way for getting the complete list of
values in an object (Guile itself uses scm_struct_ref (value,SCM_INUM0)).

While there is a macro VALUESP for figuring out whether an SCM is a
values object, it is not documented either.

-- 
David Kastrup





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#11764: Missing C API doc for accessing unknown number of values
  2012-06-22 15:17 bug#11764: Missing C API doc for accessing unknown number of values David Kastrup
@ 2012-07-04 15:52 ` Andy Wingo
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Wingo @ 2012-07-04 15:52 UTC (permalink / raw)
  To: David Kastrup; +Cc: 11764-done

Hi David,

Thanks for the report.  I've added this somewhat strangely named
function:

 -- C Function: size_t scm_c_nvalues (SCM obj)
     If OBJ is a multiple-values object, returns the number of values
     it contains.  Otherwise returns 1.

Incidentally there is also this new one:

 -- C Function: SCM scm_c_values (SCM *base, size_t n)
     `scm_c_values' is an alternative to `scm_values'.  It creates a
     new values object, and copies into it the N values starting from
     BASE.

     Currently this creates a list and passes it to `scm_values', but we
     expect that in the future we will be able to use more a efficient
     representation.

Suggestions for different names are welcome.

Regards,

Andy
-- 
http://wingolog.org/





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-04 15:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-22 15:17 bug#11764: Missing C API doc for accessing unknown number of values David Kastrup
2012-07-04 15:52 ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).