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: djello@well.sf.ca.us (Darius Bacon)
Date: 4 Jan 1996 10:49:23 GMT
Organization: The Whole Earth 'Lectronic Link, Sausalito, CA
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))))
 
This assumes what makes parenthephobes go `yuck' is the spareness of prefix
notation with positional arguments, not the parentheses themselves -- as the
success of Tcl suggests.  People might want an `infix' macro, too, as in
(infix x * (f x) + y * (f y)).
 
(I prefer Scheme just the way it is, btw.)
 
>So you end up with things like [set $a $a+1].
 
set a [expr $a+1], not that that affects your point.
 
__
Darius Bacon     http://www.well.com/user/djello/

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