diff --git a/examples/embedding/embedding.c b/examples/embedding/embedding.c index 1e66b91c1c2893..3fc8c80d673ecf 100644 --- a/examples/embedding/embedding.c +++ b/examples/embedding/embedding.c @@ -94,7 +94,7 @@ int main() jl_eval_string("this_function_does_not_exist()"); if (jl_exception_occurred()) { - jl_show(jl_stderr_obj(), jl_exception_occurred()); + jl_call2(jl_get_function(jl_base_module, "show"), jl_stderr_obj(), jl_exception_occurred()); jl_printf(jl_stderr_stream(), "\n"); } diff --git a/src/jlapi.c b/src/jlapi.c index f1c74e0406b3a0..096ae07c6227f0 100644 --- a/src/jlapi.c +++ b/src/jlapi.c @@ -83,7 +83,6 @@ JL_DLLEXPORT jl_value_t *jl_eval_string(const char *str) jl_exception_clear(); } JL_CATCH { - //jl_show(jl_stderr_obj(), jl_exception_in_transit); r = NULL; } return r; diff --git a/src/julia.h b/src/julia.h index 40164830d8a315..434f3671f4eee8 100644 --- a/src/julia.h +++ b/src/julia.h @@ -1662,7 +1662,6 @@ JL_DLLEXPORT JL_STREAM *jl_stdin_stream(void); JL_DLLEXPORT JL_STREAM *jl_stderr_stream(void); // showing and std streams -JL_DLLEXPORT void jl_show(jl_value_t *stream, jl_value_t *v); JL_DLLEXPORT void jl_flush_cstdio(void); JL_DLLEXPORT jl_value_t *jl_stdout_obj(void); JL_DLLEXPORT jl_value_t *jl_stderr_obj(void); diff --git a/src/rtutils.c b/src/rtutils.c index cb15ff3e4f8db5..66cb6bb3b7f39e 100644 --- a/src/rtutils.c +++ b/src/rtutils.c @@ -439,27 +439,6 @@ JL_DLLEXPORT jl_value_t *jl_stderr_obj(void) return stderr_obj; } -static jl_function_t *jl_show_gf=NULL; - -JL_DLLEXPORT void jl_show(jl_value_t *stream, jl_value_t *v) -{ - if (jl_base_module) { - if (jl_show_gf == NULL) { - jl_show_gf = (jl_function_t*)jl_get_global(jl_base_module, jl_symbol("show")); - } - if (jl_show_gf==NULL || stream==NULL) { - jl_printf(JL_STDERR, " could not show value of type %s", - jl_symbol_name(((jl_datatype_t*)jl_typeof(v))->name->name)); - return; - } - jl_value_t *args[3] = {jl_show_gf,stream,v}; - size_t last_age = jl_get_ptls_states()->world_age; - jl_get_ptls_states()->world_age = jl_get_world_counter(); - jl_apply(args, 3); - jl_get_ptls_states()->world_age = last_age; - } -} - // toys for debugging --------------------------------------------------------- static size_t jl_show_svec(JL_STREAM *out, jl_svec_t *t, const char *head, const char *opn, const char *cls) @@ -871,8 +850,7 @@ static size_t jl_static_show_x_(JL_STREAM *out, jl_value_t *v, jl_datatype_t *vt static size_t jl_static_show_x(JL_STREAM *out, jl_value_t *v, struct recur_list *depth) { - // mimic jl_show, but never calling a julia method and - // never allocate through julia gc + // show values without calling a julia method or allocating through the GC if (v == NULL) { return jl_printf(out, "#"); } diff --git a/src/toplevel.c b/src/toplevel.c index 8d70905d9e4946..37cf7f97e440f2 100644 --- a/src/toplevel.c +++ b/src/toplevel.c @@ -461,8 +461,6 @@ static jl_method_instance_t *jl_new_thunk(jl_code_info_t *src, jl_module_t *modu jl_value_t *jl_toplevel_eval_flex(jl_value_t *e, int fast, int expanded) { jl_ptls_t ptls = jl_get_ptls_states(); - //jl_show(ex); - //jl_printf(JL_STDOUT, "\n"); if (!jl_is_expr(e)) { if (jl_is_linenode(e)) { jl_lineno = jl_linenode_line(e); diff --git a/ui/repl.c b/ui/repl.c index 4c998ce2626955..5f8f066cccb46c 100644 --- a/ui/repl.c +++ b/ui/repl.c @@ -52,7 +52,7 @@ static int exec_program(char *program) jl_value_t *errs = jl_stderr_obj(); jl_value_t *e = ptls->exception_in_transit; // Manually save and restore the backtrace so that we print the original - // one instead of the one caused by `jl_show`. + // one instead of the one caused by `show`. // We can't use safe_restore since that will cause any error // (including the ones that would have been caught) to abort. uintptr_t *volatile bt_data = NULL; @@ -61,7 +61,7 @@ static int exec_program(char *program) if (errs) { bt_data = (uintptr_t*)malloc(bt_size * sizeof(void*)); memcpy(bt_data, ptls->bt_data, bt_size * sizeof(void*)); - jl_show(errs, e); + jl_call2(jl_get_function(jl_base_module, "show"), errs, e); jl_printf(JL_STDERR, "\n"); free(bt_data); }