vm_obj put_nat(vm_obj const & n, vm_obj const &) { if (is_simple(n)) get_global_ios().get_regular_stream() << cidx(n); else get_global_ios().get_regular_stream() << to_mpz(n); return mk_vm_unit(); }
vm_obj get_line(vm_obj const &) { if (get_global_ios().get_options().get_bool("server")) throw exception("get_line: cannot read from stdin in server mode"); std::string str; std::getline(std::cin, str); return to_obj(str); }
vm_obj format_print_using(vm_obj const & fmt, vm_obj const & opts, vm_obj const & /* state */) { get_global_ios().get_regular_stream() << mk_pair(to_format(fmt), to_options(opts)); return mk_io_result(mk_vm_unit()); }
vm_obj put_str(vm_obj const & str, vm_obj const &) { get_global_ios().get_regular_stream() << to_string(str); return mk_vm_unit(); }