mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-20 06:09:18 +02:00
Giving a more helpful error message when not all I/O ports are available in the repl.
This commit is contained in:
parent
7b23858d86
commit
2a8fe7738e
1 changed files with 4 additions and 0 deletions
4
main.c
4
main.c
|
@ -181,6 +181,10 @@ static void repl (sexp ctx, sexp env) {
|
|||
in = sexp_param_ref(ctx, env, sexp_global(ctx, SEXP_G_CUR_IN_SYMBOL));
|
||||
out = sexp_param_ref(ctx, env, sexp_global(ctx, SEXP_G_CUR_OUT_SYMBOL));
|
||||
err = sexp_param_ref(ctx, env, sexp_global(ctx, SEXP_G_CUR_ERR_SYMBOL));
|
||||
if (!(sexp_iportp(in) && sexp_oportp(out) && sexp_oportp(err))) {
|
||||
fprintf(stderr, "No standing I/O ports found, aborting. Maybe a bad -x language?\n");
|
||||
exit_failure();
|
||||
}
|
||||
sexp_port_sourcep(in) = 1;
|
||||
while (1) {
|
||||
sexp_write_string(ctx, "> ", out);
|
||||
|
|
Loading…
Add table
Reference in a new issue