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: Thu, 4 Jan 96 10:51:30 EST
djello@well.sf.ca.us (Darius Bacon) writes:
> 
> Paul Wilson proposed a syntax for shell programming:
> >   1. Common special forms like IF use balanced keywords (maybe palindromic,
> >      as above, maybe not) which act as implicit parentheses as well as
> >      specifying which special form is meant.
>  
> I think you can get the benefits of this idea with a loop-macro style of
> syntax, like so:
>  
> (define (gosh wow)
>   (let (x = (* wow wow))
>        (y = 42)
>    in (if foo
>        then (+ x y)
>        else (- x))))

I'm surprised nobody besides me has mentioned that ML already has this
kind of syntax, and that since the proposed ideas look so much like
ML, nobody has said, "Hey, why don't we make Scheme look like ML?"
(or to carry it further, "Hey, why don't we use ML instead, and create
an ML shell?" :-))

Equivalent of above:

fun gosh wow =
  let val x = wow * wow
      val y = 42
  in if foo
     then x + y
     else ~ x
  end;

Note that no parentheses at all are necessary for this example.

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

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