[plt-scheme] Paren Paralysis Sufferers Unite

From: Carl Eastlund (carl.eastlund at gmail.com)
Date: Wed Oct 21 21:40:43 EDT 2009

On Wed, Oct 21, 2009 at 9:33 PM,  <hendrik at topoi.pooq.com> wrote:
>
> OK.  Here's what I used in a Lisp dialect once:
>
>     ( foofoofoo / barbarbar )
>
> means
>
>     ( foofoofoo ( barbarbar ))
>
> where foofoofoo and barbarbar are each sequences of s-expressions.
>
> Of course, you can iterate:
>
>    ( foo / bar / clum / ink )
>
> means
>
>    ( foo ( bar ( clum ( ink ))))
>
> And that's all there is to it.
>
> It was inspired by notincing that huge clusters of close-parenthese
> arise.  This gets rid of most of them.
>
> And you can write it vertically if you want:
>
>    ( foo
>    / bar
>    / clum
>    / ink
>    )
>
> if you like lining things up vertically.
>
> This is useful for some kinds of nested if's:
>
>    ( if a b
>    / if c d
>    / if e f
>    / error 'nogood
>    )
>
>  It also leads to a desire for constructs that don't themselves contain
> lists as a syntactic hack to cut down on nesting. It makes if's easier
> to use than cond's, for example.

...of course, now I can't copy/paste the expression where you invoke
error on 'nogood, because you've gotten rid of the separate set of
parentheses.  It can be convenient to have very regular syntax,
especially when you have a computer to help you manipulate it.  The
more "human-intuitive" you try to make your syntax, the less
computer-amenable it becomes.

--Carl


Posted on the users mailing list.