[plt-scheme] Parentheses and color

From: hendrik at topoi.pooq.com (hendrik at topoi.pooq.com)
Date: Wed Jul 4 10:23:52 EDT 2007

On Wed, Jul 04, 2007 at 10:19:20AM -0400, Eli Barzilay wrote:
> On Jul  4, hendrik at topoi.pooq.com wrote:
> > On Tue, Jul 03, 2007 at 11:01:00PM -0400, Eli Barzilay wrote:
> > > Say that you have this:
> > > 
> > >   (define (foo x y)
> > >     (bar (blah x)
> > >          y))
> > > 
> > > and you want to put the body in a parameterize.  IIUC, you'll stick
> > > the "(parameterize ([my-param 1])" line, then the closing paren (which
> > > you'll look for using colors (which will be confusing, because you
> > > added a new paren so the colors don't match)), and then reindent.
> > > 
> > > Here's what I'll do:
> > > 
> > > * Put the cursor right before the "(bar ..." line
> > > * `M-S-right'        (`M' is usually the `alt' key)
> > > * `M-('              (that is, alt+shift+9 on a us keyboard)
> > > * type "parameterize "
> > > * `M-('
> > > * `M-['
> > > * type "my-param 1"
> > > * `right' `right'    (to go to where the line should break)
> > > * `enter'
> > > * `M-S-right' `tab'  (to reindent the body)
> > > 
> > > If you follow this editing sequence, you'll see for yourself that
> > > paren counting is never part of the game.  And much more better:
> > > parens are there mostly to guide the editor -- in this editing
> > > sequence you don't have to even look at them, you only use them to be
> > > able to select the body in one key.
> > 
> > When I did this, I got
> > 
> > (define (foo x y)
> >     S(bar (blah x)
> >          y)(parameterize([mu-param 1])
> >              S))
> > 
> > Is that was was desired?
> 
> A `M-' prefix is alt (usually) and a `S-' prefix is shift, so
> `M-S-right' is holding alt+shift and pressing the right button.

I knew about M being alt or esc, but not S being shift.  Knowing that 
helps a *lot*.

-- hendrik

> 
> -- 
>           ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
>                   http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.