[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing multiple values from C

From: Mark H Weaver
Subject: Re: Accessing multiple values from C
Date: Tue, 17 Jan 2012 22:15:24 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

Hi Julian, thanks for working on this!

Julian Graham <address@hidden> writes:
> +SCM
> +scm_c_value_ref (SCM obj, size_t idx)
> +{
> +  SCM values = scm_struct_ref (obj, SCM_INUM0);
> +  return scm_list_ref (values, SCM_I_MAKINUM (idx));
> +}
> +

Should this verify that `obj' is a values object?

Should it verify that `idx' can fit in an inum?

Also, if `obj' is _not_ a values object and `idx' is 0, should this
simply return `obj'?  Since a single value is conceptually no different
than multiple values (but is represented very differently within Guile),
I'd think that this function should handle that case gracefully.

What do other people think?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]