return i;
}
}
+
+
+void
+cos_print_object (COS_object obj)
+{
+ if ( obj == NULL )
+ printf ("#<NULL>", obj);
+ else if ( COS_OBJECT_INT_P (obj) )
+ printf ("%d", cos_int_value (obj));
+ else if ( COS_OBJECT_CHAR_P (obj) )
+ {
+ char id_buf[256];
+
+ cos_utf8_print_char (obj, id_buf, 256);
+ printf ("?%s", id_buf);
+ }
+ else if ( COS_OBJECT_STRING_P (obj) )
+ {
+ printf ("\"%s\"", cos_string_data (obj));
+ }
+ else if ( COS_OBJECT_SYMBOL_P (obj) )
+ {
+ printf ("%s", cos_string_data (cos_symbol_name (obj)));
+ }
+ else if ( COS_OBJECT_CONS_P (obj) )
+ {
+ COS_object rest = COS_CDR (obj);
+
+ printf ("(");
+ cos_print_object (COS_CAR (obj));
+ while ( COS_OBJECT_CONS_P (rest) )
+ {
+ printf (" ");
+ cos_print_object (COS_CAR (rest));
+ rest = COS_CDR (rest);
+ }
+ if ( rest != cos_Qnil )
+ {
+ printf (" . ");
+ cos_print_object (rest);
+ }
+ printf (")");
+ }
+ else
+ printf ("Object[0x%lX] is a fat object.\n",
+ obj);
+}