[plt-scheme] Paren Paralysis Sufferers Unite
These tricks are great, I use them all the time in my coding even
though I've been at it for a while now. Its just so much easier to
think line by line instead of trying to keep track of which set of
parens I am in on a single line.
Also, as a tutor I teach my students the same concept of paren pairing
and filling with {} in c-style languages.
On Fri, Oct 16, 2009 at 1:04 PM, David Storrs <david.storrs at gmail.com> wrote:
> On Fri, Oct 16, 2009 at 3:55 PM, Carl Eastlund <carl.eastlund at gmail.com> wrote:
>
>> That, and use a Scheme-conscious editor like DrScheme (or Emacs or vi,
>> if you're familiar).
>
> Carl beat me to it on this one.
>
> Two more tricks you can do to simplify your life:
>
> 1) Always write parens in pairs, then fill in what goes inside them.
>
> 2) Add newlines to make it clearer what goes with what. This isn't
> the "done thing" in Scheme, but it's a useful tool while you're
> learning. So:
>
> (define (foo a b (c 7))
> (let (
> (x a)
> )
> (begin
> (display a b c)
> )
> )) ; let and define
>
> A decent editor will handle the alignment for you.
>
> --Dks
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>