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: Franklin Chen <chen@adi.com>
Date: Tue, 2 Jan 96 19:24:14 EST
wilson@cs.utexas.edu (Paul Wilson) writes:
> Most people who try to design a new syntax for Lisp or Scheme try to
> make it look like Pascal or C, which may be a poor fit.  (Actually,
> I like Dylan's syntax reasonably well, but it's a little too verbose,
> and it's not designed for interactive commands.)  I'm interested in
> exploring other alternatives, which may seem radical in the context
> of conventional programming languages, but not at all weird in the
> context of normal interactive computer use.  I don't want to sacrifice
> having a good syntax for programming in the large, but I think that
> maybe if we re-think syntax a little, we don't have to sacrifice much
> at all.
> 
> 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.)
> 
> For example,
> 
>    (define (foo bar baz)
>       (if bar
>           (quux (bleen baz))
>           (quux baz)))
> 
> would look something like
> 
>    def (foo bar baz)
>       if bar
>       then (quux (bleen baz))
>       else (quux baz)
>       fi
>    fed

This kind of syntax is not new; the omission of parentheses is a
common feature of various functional languages, e.g., Standard ML:

fun foo(bar, baz) =
  if bar
  then quux (bleen baz)
  else quux baz;

I think it's very natural going without parentheses.  Of course, you'd
have to learn a bunch of keywords and rules about semicolons,
precedence, associativity...

-- 
Franklin Chen                                              chen@adi.com
Applied Dynamics International
3800 Stone School Road
Ann Arbor, MI 48108

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