Dan Sugalski <[EMAIL PROTECTED]> writes:
>At 05:39 PM 8/2/00 +0100, Tim Bunce wrote:
>>On Wed, Aug 02, 2000 at 12:05:20PM -0400, Dan Sugalski wrote:
>> >
>> > Reference counting is going to be a fun one, that's for sure.
>> >
>> > I'd like the interface to be something like:
>> >
>> >    stat = perl_get_value(sv *, int what, &destination)
>>
>>And what type is perl_get_value declared as returning?
>
>An integer--it is a status value after all...

Are we sure the value to be should not be returned and the status to be 
the extra arg?

It is neater to be able to say 
        
   int err;
   int circ = perl_get_value(radius_sv,PL_INTEGER,&err)*2*M_PI;

rather than:

   int radius;
   int err = perl_get_value(radius_sv,PL_INTEGER,&radius);
   int circ = radius*2*M_PI; 
   
Remember the compiler cannot put anything which has its address taken 
in a register - so if the value is likely to be used in an expression 
it is better to avoid forcing it to the stack.

-- 
Nick Ing-Simmons <[EMAIL PROTECTED]>
Via, but not speaking for: Texas Instruments Ltd.

Reply via email to