void error (char *message, char *location) { type_error *e = gc_malloc (sizeof(type_error)); if (message != NULL) { e->message = gc_new_string(message); } else { e->message = gc_new_string(""); } if (location != NULL) { e->location = gc_new_string(location); } else { e->location = gc_new_string(""); } e->next = error_p; error_p = e; }
void ref_print( Object *me, int tabs ){ if( ob_ref_ucast(me)->value ){ ob_print( ob_ref_ucast(me)->value, tabs ); } else{ ob_print( (Object *)gc_new_string("<null>"), tabs ); } }
Object *float_inplace_add( Object *me, Object *op ){ if( ob_is_string(op) ){ string mvalue = ob_svalue(me), svalue = ob_svalue(op); me = (Object *)gc_new_string( (mvalue + svalue).c_str() ); } else{ ob_float_ucast(me)->value += ob_fvalue(op); } return me; }
Object *float_add( Object *me, Object *op ){ if( ob_is_string(op) ){ string mvalue = ob_svalue(me), svalue = ob_svalue(op); return (Object *)gc_new_string( (mvalue + svalue).c_str() ); } else{ double fvalue = ob_fvalue(op); return (Object *)gc_new_float( ob_float_ucast(me)->value + fvalue ); } }
Object * ref_to_string( Object *me ){ return ob_ref_ucast(me)->value ? ob_to_string( ob_ref_ucast(me)->value ) : (Object *)gc_new_string("<null>"); }
Object * float_to_string( Object *me ){ return (Object *)gc_new_string( ob_svalue(me).c_str() ); }