[Top][All Lists]

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

Re: Accessing multiple values from C

From: Ludovic Courtès
Subject: Re: Accessing multiple values from C
Date: Wed, 18 Jan 2012 21:19:04 +0100
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux)

Hi Mark,

Mark H Weaver <address@hidden> skribis:

> 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?

Yes, good point.  Using an ‘SCM_VALIDATE’, which will throw an exception
upon error, right?

> Also, if `obj' is _not_ a values object and `idx' is 0, should this
> simply return `obj'?

Yes, makes sense to me.

Julian: could you change these bits and send an updated patch?


reply via email to

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