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

Robby Findler robby at cs.uchicago.edu
Wed Apr 16 07:36:02 EDT 2008


On Wed, Apr 16, 2008 at 12:58 AM, Noel Welsh <noelwelsh at gmail.com> wrote:
> On Wed, Apr 16, 2008 at 12:12 AM, Richard Cobbe <cobbe at ccs.neu.edu> wrote:
>  >
>  >     #!/path/to/mzscheme
>  >     #lang mzscheme
>  >
>  >     (define (run)
>  >        (pretty-print (munge-input (read))))
>  >
>  >     (define munge-input ...)
>  >
>  >     (run)
>  >
>
>  I would split this into two modules.  One defines munge-input, the
>  other provides the script wrapper around it.  Now you can test
>  munge-input in the usual way.

Oh, right! I should have thought of that myself. One wants to be able
to use unit tests for munge-input, no?

Robby


More information about the plt-scheme mailing list