From: Chris.Bitmead@alcatel.com.au (Chris Bitmead uid(x22068))
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Date: 18 Apr 1997 10:24:54 +1000
I've often thought that if I ever wrote a Scheme shell, I would
provide an option to put in a line prefix and suffix to lines just to
satisfy this point. You might do something like this...
> (write 'foobar)
> (set! prefix "(")
(> set! suffix ")")
(&)> write 'foobar
As you see, by setting the prefix and suffix variables a "(" and ")"
would automatically be prepended and appended to each line you
type. The prompt would change to "(&)" to remind you that this is in
effect. If you wanted a shell like a Unix shell that runs other
processes you might change it to "(run &)" which would automatically
call the run procedure on anything you type in. This would allow you
to type ls -l at the prompt and have it work.
I would suggest that you'd be better off sticking with a classic
shell-like syntax for the common, everyday issuing of commands, not
simply punting the outer layer of parens. Globbing, for example, is
an important interface between the filesytem and the command line arguments
given to programs. This is built in to the syntax of typical interactive
If you wanted to do an interactive shell on top of Scheme, you would
want to implement a lexer/parser to handle the shell syntax. You would
also want to tweak the design of the shell syntax to allow escapes to
Scheme for complex things. Having escapes to Scheme syntax and semantics
would punt a lot of unnecessary things from your simple, interactive
command language that are necessary for scripting, because you always
have Scheme for them, such as conditionals and other control-flow operators.
I discuss these issues at some length in the papers I've written on scsh,
the Scheme shell. You can find them at
by following the link to "Technical papers."
I would further suggest that you'd be even better off punting this whole
idea of the command-line/transcript model of shell interaction. You could
instead use the emacs editor Edwin (written in Scheme) together with the
Unix API provided by scsh to do a screen-oriented shell, where common
commands would be bound to control keys, less common commands invoked from
meta-x, and complex operations performed by entering fragments of Scheme
and scsh process notation. Best of both worlds -- interactivity and
I've always wanted to do this, but it's not the sort of thing for which