[plt-scheme] Can a module tell if it's being run interactively?

From: Richard Cobbe (cobbe at ccs.neu.edu)
Date: Tue Apr 15 22:12:07 EDT 2008

On Tue, Apr 15, 2008 at 07:42:16PM -0400, Matthias Felleisen wrote:
> At some point Robby will turn into a systems guy and produce a full-fledged
> virtual script IDE. In the meantime, you may wish to consider turning your
> input for debug mode into a command-line argument and supplying them via
> the language menu (details) so you don't have to re-type them and so you
> don't have to remember to comment out anything when done debugging.
> (Unless your input is truly large.) -- Matthias

If I read this correctly, you're suggesting that I take the text that is
currently coming in on stdin and put it on the command line, right?

Unfortunately, I don't think that's practical here, for two reasons.
First, this particular input is about 13K, and while this is within the OS
limits for command line length, it's long enough to be a pain --- and I
expect to deal with larger inputs at some point.  Second, the input is an
sexpr representation of a Java class definition, and there are lots of
string literals inside it, so I'd have to escape double quotes and
backslashes throughout.

I'll probably just bite the bullet and have the script take the input
filename as a command line argument, with the standard unix shorthand of -
for stdin so I can continue to use it in a pipeline from the shell.



Posted on the users mailing list.