scsh-users
[Top] [All Lists]

Re: Perl, English, syntax for Scheme and shells (was Re: scsh in scm ...

To: scsh@martigny.ai.mit.edu
Subject: Re: Perl, English, syntax for Scheme and shells (was Re: scsh in scm ...)
From: cbartley@macromedia.com (Curtis Bartley)
Date: Wed, 03 Jan 1996 14:21:44 -0500
Organization: Macromedia, Inc.
In article <4cc999$424@jive.cs.utexas.edu>, wilson@cs.utexas.edu (Paul
Wilson) wrote:

> The idea I'm toying with is to eliminate most of the parentheses in
> normal Scheme expressions, in a fairly straightforward way---by making
> them implicit in common expression types.  (Note: the following has
> not been thoroughly thought out.  Comments welcome, and flames to
> dev/null.)

Shell scripting languages are traditionally used in one of two ways:
immediately, line-by-line, at a command prompt, or typed out in a text
editor, stored in a file, and executed later as a unit.

Traditionally scripting language design tends to favor the former usage at
the expense of the latter.  It's much easier and faster to type

   > cd source

Than 

   > cd("source"); 

I personally wouldn't use a shell that required me to type the latter at a
command prompt, if I had any choice.  However, if all I were doing were
writing script files, I don't find the latter particularly egregious.  In
some cases, (like where the former style would require extensive variable
substitution) the latter style is much preferable.

It seems to me that the two styles don't need to be exclusive.  The basic
shell scripting language could be based on a more traditional programming
language (like scheme).  However, to facilitate immediate command line
usage, a raw command line would be preprocessed to convert it from the
easy to type on the fly form to the standard form.  For example:

   > cd source

Would get preprocessed to

  > (cd "source")

If you just had to use the more traditional form at the prompt there could
be someway to escape it:

   > { (cd "source") }

This would most likely be useful for complicated expressions that can't be
typed rapidly anyway.

A script *file* would work in reverse -- the default mode would be the
standard form, where an escape might allow the use of the preprocessed
command line form.

So you could have a command line friendly language and scheme too.

-- Curtis (cbartley@macromedia.com)

<Prev in Thread] Current Thread [Next in Thread>