The correct option is
gsi -:d-
Thanks, Marc, and I see it's in the Gambit manual, clearly enough:
The `d' option sets various debugging options. The letter `d' is followed by a sequence of letters indicating suboptions. [...]
`i' The REPL interaction channel will be the IDE REPL window (if the IDE is available).[...]
`-' The REPL interaction channel will be standard input and standard output.[...]
The default debugging options are equivalent to `-:dpqi1'
But as I usual I'll carp that something this important should be explained at top level. Or is it not important? Don't folks `time' their long bg jobs?
Anyway, I can't get it to work for gsc/gcc. This works fine:
% m six.scm (time (pretty-print 6))
% export GAMBCOPT=d-
% gsi six.scm > 13-73put
% more 13-73put 6 (time (pretty-print 6)) 0 ms real time 0 ms cpu time (0 user, 0 system) no collections 104 bytes allocated no minor faults 5 major faults
But I lose the `time' info with gsc/gcc:
% gsc six % gcc -O2 -L. -I. six.c six_.c -lgambc % ./a.out > 13-73put % more 13-73put
Now Brad, I think this is wrong:
I think the manual may be in error; I think the time info goes to stderr, not stdout. If you're using csh or tcsh, you can try
gsi -:- 6.scm >& six
I don't know how to do it with bash or /bin/sh.
Yeah, >& redirects both stderr & stdout in bash, and I tried that. But the local hotshot here said it was a stdin problem. Note how he realized it was a runtime problem, which I hadn't mentioned:
FYI, the "Stopped" message in the line
[1]+ Stopped nice ./73a.out 1>&13-73put
means the process is trying to read, or otherwise access, stdin while detached. In a high-level language like Scheme, this can be reflect internal workings of the runtime support, rather than explicit instructions of your program.
Thanks, Rico!