thanks, i see now. since its a list it would be nice from the users
perspective to be able to pass immediate ints in addition to floats
without having to cons the floats on the scheme side. so on the c side
ill have to make sure that the car is either an int or a float before
i access it -- ive been poking around in the doc but dont see any
obvious predicates to do this. can you please point me in the right
direction? thanks for your help!
for ( ; C_SCHEME_END_OF_LIST != lyst; lyst = C_u_i_cdr( lyst )) {
if ( IS_INT(C_u_i_car(lyst)) )
sum += (double)C_u_i_car(lyst) ;
else if ( IS_FLOAT(C_u_i_car(lyst))
sum += C_u_i_car(lyst) ;
}
But this works:
#>
static double
double_sum( C_word lyst )
{
double sum = 0.0;
for ( ; C_SCHEME_END_OF_LIST != lyst; lyst = C_u_i_cdr( lyst )) {
sum += C_flonum_magnitude( C_u_i_car( lyst ) );
}
return sum;
}
<#
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users