chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] C_truep( C_fixnump( w ))


From: Heinrich Taube
Subject: [Chicken-users] C_truep( C_fixnump( w ))
Date: Sun, 24 Feb 2008 11:52:13 -0600

hi im using chicken 3.0.0 im trying to parse a list of floats and/or ints that come from scheme.

in the example below the floating point test:

   if (C_truep( C_flonump( w ) ))

works fine but the integer test

   else if (C_truep( C_fixnump( w ) ))

crashes my app. im not sure what is wrong and ive spent about an hour trying to figure this out. aplogies if its somethig stupid that my eyes are not seeing! note that its the actuall test not the printf thats crashing, (if i comment out the printf it still crashes).

 int i=0;
 for (; C_SCHEME_END_OF_LIST != lyst; lyst = C_u_i_cdr( lyst ) ) {
   C_word w = C_u_i_car( lyst );
   if (C_truep( C_flonump( w ) )) {
      printf("FLO: buf[%d]=%f\n", i++, (float)C_flonum_magnitude( w ));
      }
   else if (C_truep( C_fixnump( w ) )) {
      printf("FIX: buf[%d]=%d\n", i++, C_unfix( w ));
   }
   else {
   }
 }




reply via email to

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