void _BigInteger_asString(pVMObject object, pVMFrame frame) { pVMBigInteger self = (pVMBigInteger)SEND(frame, pop); // temporary storage for the number string // use c99 snprintf-goodie int64_t bigint = SEND(self, get_embedded_biginteger); char* strbuf = (char*)internal_allocate(snprintf(0, 0, "%lld", bigint) +1); sprintf(strbuf, "%lld", bigint); SEND(frame, push, (pVMObject)Universe_new_string(strbuf)); internal_free(strbuf); }
void _Symbol_asString(pVMObject object, pVMFrame frame) { pVMSymbol sym = (pVMSymbol)SEND(frame, pop); const char* chars = SEND(sym, get_chars); SEND(frame, push, (pVMObject)Universe_new_string(chars)); }