On Jan 19, 2012, at 8:26 PM, Mark Nutter wrote:

> On Thu, Jan 19, 2012 at 11:42 AM, David Brunell <quantal...@gmail.com> wrote:
>> How long did it take you to get comfortable with paredit?  I keep getting
>> frustrated and going back to manually matching parens.
> 
> I had the same experience for a while, but then I realized I just had
> to remember 3 things:
> 
> To enclose an existing sexp inside a new one [etc]
> 
> To pull an existing sexp out of its enclosing sexp [etc]

And don't forget: To cut/paste arbitrary chunks of code that may contain either 
multiple expressions and/or unbalanced brackets, OR to write free-form 
pseudo-code that you then replace with actual code bit by bit (both of which I 
do frequently): Issue a blood curdling scream, give up, and edit in plain text 
in some other editor. :-) YMMV of course, and I'm not knocking it for others, 
but this is why I can't live in paredit. It also does all sorts of problematic 
things when I screw up and delete by backing up with the delete key, which is 
just the way that I type and I do it automatically all of the time (probably 10 
times in the composition of this message).

On this last item:

> If you put the cursor on the opening paren and then hit C-k, it cuts
> out exactly that sexp (and its contents) but no more, keeping the
> parens perfectly balanced.
> 
> That last trick is what made paredit a must-have for me, because I do
> a lot of cut and paste, and paredit makes it a piece of cake. You
> don't have to worry about selecting the beginning and ending parens,
> just put the cursor on the open paren and hit C-k, and it cuts exactly
> as much as it needs to grab a balanced sexp, even across multiple
> lines, leaving any other close-parens untouched. It's awesome.

That is indeed a great thing, but it's not conceptually tied to the other 
features of paredit. In the wonderful FRED editor that I mentioned previously 
you could double click on a bracket and it would select the entire expression 
to the matching bracket. So cutting something while maintaining balance was 
just a double click followed by the ordinary, OS-idiomatic cut key command.

One other lovely feature that wasn't built in to FRED but was available as a 
simple extension (simple because FRED could be extended using Common Lisp, just 
as Emacs can be with emacs Lisp) allowed you to option-click on a bracket to 
copy the entire bracketed expression to the current insertion point. Made it 
really fast and elegant to copy chunks of code to multiple places, etc.

All of these things are conceptually compatible with free-form typing and also 
with an OS-idiomatic editing interface. Not that any existing Clojure IDE does 
all of this, but it's not impossible and maybe some day...

-Lee

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to