Re: Redefine read-eval-print loop?
> Jesse Schell writes
> I have a need to alter the STk read-eval-print loop in a way that
> prevents it from printing after evaluation. Some versions of scheme
> let you alter this loop directly; others have more segmented
> interfaces. For example, in Chez Scheme I would change the
> (waiter-print) routine.
>
> How can I do this in STk?
Current version does not allow to do this. I suppose that you when
you don't want to see results, you are not in interactive mode.
A simple fix of could be:
*** Src/toplevel.c~ Sun Mar 23 19:51:04 1997
--- Src/toplevel.c Sun Mar 23 19:51:17 1997
***************
*** 258,265 ****
longjmp(*Top_jmp_buf, JMP_RESTORE);
}
else {
! STk_print(x, STk_curr_oport, WRT_MODE);
! Putc('\n', STk_stdout);
}
}
}
--- 258,267 ----
longjmp(*Top_jmp_buf, JMP_RESTORE);
}
else {
! if (STk_interactivep) {
! STk_print(x, STk_curr_oport, WRT_MODE);
! Putc('\n', STk_stdout);
! }
}
}
}
I suspect that it is not as general as the Chez Scheme solution, but it
probably works
(Please tell me if this is not the case)
BTW, I have already applied this change since it seems coherent with the fact
that
the prompt is not displayed if mode is not interactive.
-- Erick
Received on Sun Mar 23 1997 - 22:12:40 CET
This archive was generated by hypermail 2.3.0
: Mon Jul 21 2014 - 19:38:59 CEST