Using Paredit’s Slurp and Barf

I’ve been using paredit for 11 or 12 years. I don’t use nearly all its features but I still wouldn’t want to live without it. As I discovered early on, the real secret of paredit is understanding slurp and barf. Without them you can’t edit your file effectively.

Susam Pal has a short post about mnemonics for remembering the shortcuts for paredit’s slurp and barf. Some developers, he says, confuse the shortcuts for snarfing for those for slurping. Pal provides the mnemonics that he used to remember them. I never had that problem. To me, the braces suggest pointing out so Ctrl+} and Ctrl+{ are clearly for barfing.

Actually, I don’t find his mnemonics very helpful but your mileage may vary. His post also gives examples of using slurp and barf so you may find that helpful if you’re not familiar with paredit. One thing for sure, if you’re writing in any of the Lisps, learning paredit is definitely worthwhile.

This entry was posted in General and tagged . Bookmark the permalink.