SlideShare a Scribd company logo
Bay Area Clojure Meetup
          functional lispers




                                        December 3, 2009
                               Runa Galactic Headquarters


Friday, December 4, 2009
paredit
          At first it sucks, but then it’s awesome.




                                                     mudphone (kyle oba)
                                                      irc / twitter / github
                                                          runa employee 9
Friday, December 4, 2009
about runa
          We are simultaneously the largest cloud-based
          manufacturer, distributor, and consumer of
          Bavarian-style pretzels, nationally.
                               http://www.flickr.com/photos/bellalago/3938498023/
Friday, December 4, 2009
and we’re hiring
          clojure-hbase-ruby-hadoop-rails-javascript-chefs




Friday, December 4, 2009
0/8              why




Friday, December 4, 2009
Q: What is paredit?


         A: paredit is a minor mode for Emacs,
            created by Taylor R. Campbell.




Friday, December 4, 2009
commit 2ecf00a124062d7b4c4538f79426bc19c6b11b83
                           Author: Philip (flip) Kromer <flip@infochimps.org>
                           Date: Mon Aug 24 23:38:14 2009 -0500

                             Paredit fucking sucks my balls




          So, why paredit?




Friday, December 4, 2009
Because, these are your father’s parentheses...




                                              http://xkcd.com/297/

Friday, December 4, 2009
http://technomancy.us/126

          Hingebjerg – 2009-06-01T14:05:40Z
          Hi Phil,

          Just installed the emacs-starter-kit and clojure-mode, and i can't delete
          curly braces when in clojure-mode. Is there a logical explanation for that?


          Phil – 2009-06-12T09:37:15Z
          Hingebjerg: That's a feature of paredit-mode; it enforces that you can't
          delete parens (or other matched chars) unless they're empty so you
          don't end up with invalid structure in your code. It's unbelievably handy/
          addictive once you get used to it, but if you're not sure what's going on it
          can be pretty annoying.




Friday, December 4, 2009
0/8         why
          1/8         balancing
          2/8         basic insertion commands
          3/8         deleting & killing
          4/8         movement & navigation
          5/8         depth-changing commands
          6/8         barfage & slurpage
          7/8         miscellaneous commands
          8/8         in the wild (tips & tricks)

Friday, December 4, 2009
1/8              balancing




Friday, December 4, 2009
balancing basics




           keys

            ([“             ([“”])



Friday, December 4, 2009
1.1/8            assumptions




Friday, December 4, 2009
you’re using the emacs starter kit
           or, you’re already familiar setting the modes up


          you’ve got paredit and show-parens modes
           M-x paredit-mode
           M-x show-paren-mode




Friday, December 4, 2009
install?

          ;;; Install paredit by placing `paredit.el' in `/path/to/elisp', a
          ;;; directory of your choice, and adding to your .emacs file:
          ;;;
          ;;; (add-to-list 'load-path "/path/to/elisp")
          ;;; (autoload 'paredit-mode "paredit"
          ;;; "Minor mode for pseudo-structurally editing Lisp code."
          ;;; t)
          ;;;
          ;;; Toggle Paredit Mode with `M-x paredit-mode RET', or enable it
          ;;; always in a major mode `M' (e.g., `lisp' or `scheme') with:
          ;;;
          ;;; (add-hook M-mode-hook (lambda () (paredit-mode +1)))




                                                 http://mumble.net/~campbell/emacs/paredit.el

Friday, December 4, 2009
wrapping
                                  killing
                                  raising
                                  splicing
                                  slurping / barfing
          1.2/8            demo   splitting / joining




Friday, December 4, 2009
2/8 basic        insertion commands




Friday, December 4, 2009
paredit-open-round




           keys
                              (a b |c d)
                (
                              (a b (|) c d)


Friday, December 4, 2009
paredit-close-round-and-newline




           keys                (a b |c     )
                )              (a b c)
                               |

Friday, December 4, 2009
paredit-close-round




           keys
                               (a b |c    )
          M-)
                               (a b c)|


Friday, December 4, 2009
paredit-open-square




           keys
                               (a b |c d)
                [
                               (a b [|] c)


Friday, December 4, 2009
paredit-close-square




           keys
                           (defn cky [bcn|   ] 2)
                ]
                           (defn cky [bcn]| 2)


Friday, December 4, 2009
paredit-doublequote




           keys
                           (ça va |bien)
               “
                           (ça va “|” bien)


Friday, December 4, 2009
paredit-doublequote
         (while in a quote)



           keys
                           (the “q|uick” fox)
               “
                           (the “q”|uick” fox)


Friday, December 4, 2009
paredit-meta-doublequote




           keys
                           (the |(cky) bcn)
           M-”
                           (the “|(cky)” bcn)


Friday, December 4, 2009
paredit-meta-doublequote
         (while in quote)



           keys            (the “chk|y” bcn)
           M-”             (the “chky”
                                |bcn)

Friday, December 4, 2009
paredit-comment-dwim




           keys
                           (blah |xyz)   ; baz
           M-;
                           (blah xyz)    ; |baz


Friday, December 4, 2009
paredit-comment-dwim




           keys
                           (amit siva)|
           M-;
                           (amit siva)    ;|


Friday, December 4, 2009
paredit-comment-dwim

                                (hbase)
                                |
           keys                 (clojure)
           M-;                  (hbase)
                                ;;; |
                                (clojure)
Friday, December 4, 2009
paredit-comment-dwim




                            (ruby) |(java)
           keys

           M-;              (ruby)
                            ;;; |
                            (java)
Friday, December 4, 2009
paredit-newline




           keys            (let [x 2] |(list x y)
             C-j           (let [x 2]
                             |(list x y))

Friday, December 4, 2009
intermission



                           http://xkcd.com/224/
Friday, December 4, 2009
3/8 deleting     & killing




Friday, December 4, 2009
paredit-forward-delete



                           (|”third” worst)
           keys
                           (“|third” worst)
          C-d
                           (“|hird” worst)

Friday, December 4, 2009
paredit-forward-delete

                                  (w |(x) y)

           keys                   (w (|x) y)
          C-d                     (w (|) y)

                                  (w | y)
Friday, December 4, 2009
paredit-backward-delete


                             (“speed” w|alk)
           keys             (“speed” |alk)
         DEL                (“speed”|alk)
                            (“speed|”alk)
                            (“spee|”alk)
Friday, December 4, 2009
paredit-backward-delete

                                   (w (x)| y)

           keys                    (w (x|) y)
         DEL                       (w (|) y)

                                   (w | y)
Friday, December 4, 2009
paredit-kill




           keys
                           (zee)| ;comment
           C-k
                           (zee)|


Friday, December 4, 2009
paredit-kill


                           (|zee) ;comment

           keys            (|) ;comment
           C-k
                           (println “|x is:” x)
                           (println “|” x)
Friday, December 4, 2009
paredit-forward-kill-word



                           |(declare x) ;comment
           keys
                           (| x) ;comment
          M-d
                           (|) ;comment
                           () ;|
Friday, December 4, 2009
paredit-forward-kill-word

                                     ;| hack
                                     (declare x)
           keys
                                     ;|
          M-d                        (declare x)
                                     ;
                                     (| x)
Friday, December 4, 2009
paredit-backward-kill-word

                           (declare x) ;comment
                           (zee) |
           keys
                           (declare x) ;comment
        M-DEL
                           (|)

                           (declare x) ;|
Friday, December 4, 2009
paredit-backward-kill-word




           keys                       (declare x) ;|
        M-DEL                         (declare |)
                                      (|)

Friday, December 4, 2009
4/8 movement     & navigation




Friday, December 4, 2009
paredit-forward




           keys
                           (conj |[1 2 3] 4)
           C-M-f
                           (conj [1 2 3]| 4)


Friday, December 4, 2009
paredit-forward




           keys            (conj [1 2 3] |4)
           C-M-f           (conj [1 2 3] 4|)
                           (conj [1 2 3] 4)|

Friday, December 4, 2009
paredit-backward




           keys
                            (conj [1 2 3]| 4)
         C-M-b
                            (conj |[1 2 3] 4)


Friday, December 4, 2009
paredit-backward




           keys             (conj| [1 2 3] 4)
         C-M-b              (|conj [1 2 3] 4)
                            |(conj [1 2 3] 4)

Friday, December 4, 2009
intermission



                           http://www.flickr.com/photos/nickporjr/2158780350/
Friday, December 4, 2009
5/8 depth-changing    commands




Friday, December 4, 2009
paredit-wrap-around




           keys
                                      (eat |cky bcn)
          M-(
                                      (eat (|cky) bcn)

            same for {}, [], and “”

Friday, December 4, 2009
paredit-splice-sexp




           keys
                           (eat (|cky bcn) sdwch)
         M-s
                           (eat |cky bcn sdwch)


Friday, December 4, 2009
paredit-splice-sexp-killing-backward




           keys
                               (eat (cky |bcn))
          M-<up>
                               (eat |bcn)


Friday, December 4, 2009
paredit-splice-sexp-killing-forward




           keys
                                (eat (cky |bcn))
         M-<down>
                                (eat cky|)


Friday, December 4, 2009
paredit-raise-sexp




           keys            (eat (cky |bcn) sdwch)
          M-r              (eat |bcn sdwch)
                           |bcn

Friday, December 4, 2009
6/8 barfage      & slurpage




Friday, December 4, 2009
paredit-forward-slurp-sexp




           keys
                               (eat (|cky) bcn z)
         C-)
         C-<right>             (eat (|cky bcn) z)


Friday, December 4, 2009
paredit-forward-barf-sexp




           keys
                               (eat (|cky bcn) z)
         C-}
         C-<left>              (eat (|cky) bcn z)


Friday, December 4, 2009
paredit-backward-slurp-sexp




           keys
         C-(                (omg eat (|cky) bcn)
         C-M-<left> (omg (eat |cky) bcn)

Friday, December 4, 2009
paredit-backward-barf-sexp




           keys
         C-{         (omg (eat |cky) bcn)
         C-M-<right> (omg eat (|cky) bcn)

Friday, December 4, 2009
7/8 miscellaneous   commands




Friday, December 4, 2009
paredit-split-sexp




           keys
                                      (cky |bcn)
          M-S-s
                                      (cky) |(bcn)

            same for {}, [], and “”

Friday, December 4, 2009
paredit-join-sexps
                                      (cky)| (bcn)
                                      (cky| bcn)
           keys
                                      chunky-
          M-S-j                       | bacon
                                      chunky-|bacon
            same for {}, [], and “”

Friday, December 4, 2009
Friday, December 4, 2009
intermission




Friday, December 4, 2009
8/8 in the wild
          (tips and tricks)




Friday, December 4, 2009
C-w is not a paredit thing
                                  show-paren-mode warning
          8.1/8            demo   fixing unbalanced parens




Friday, December 4, 2009
add parens when unbalanced
         (override matched keys w/ C-q)



           keys                       (important |
          C-q )
                                      (important )|

            same for {}, [], and “”

Friday, December 4, 2009
remove pesky spaces


                               (important
                               |       )
           keys
                               (important
           C-k
           then                |)
           <del>               (important |)
Friday, December 4, 2009
remove stray parens
         with comments

                               poor paren)|
           keys
                               poor paren|)
           DEL
           then ; then         poor paren;|)
           C-d                 poor paren;|
Friday, December 4, 2009
override paredit delete




           keys
          C-u DEL
          C-u C-d                  LTR
          C-u C-k
Friday, December 4, 2009
remove stray parens
         probably the right way



           keys
                                  poor paren)|
           C-u DEL
                                  poor paren|


Friday, December 4, 2009
dammit, emacs




           keys

           M-x butterfly    LTR



Friday, December 4, 2009
M-x butterfly
                           http://xkcd.com/378/
Friday, December 4, 2009
add paredit to the SLIME REPL

          ;; enable paredit in slime repl
          (add-hook 'slime-repl-mode-hook (lambda () (paredit-mode +1)))




                           Karol Skocik - http://coding.derkeiler.com/Archive/Lisp/comp.lang.lisp/2007-07/
Friday, December 4, 2009
customize

          ;;; Customize paredit using `eval-after-load':
          ;;;
          ;;; (eval-after-load 'paredit
          ;;; '(progn ...redefine keys, &c....))
          ;;;
          ;;; ... Now `)' is bound to a
          ;;; command that does not insert a newline, and `M-)' is bound to the
          ;;; command that inserts a newline. To revert to the former behaviour,
          ;;; add the following forms to an `eval-after-load' form for paredit.el
          ;;; in your .emacs file:
          ;;;
          ;;; (define-key paredit-mode-map (kbd ")")
          ;;; 'paredit-close-round-and-newline)
          ;;; (define-key paredit-mode-map (kbd "M-)")
          ;;; 'paredit-close-round)


                                                 http://mumble.net/~campbell/emacs/paredit.el

Friday, December 4, 2009
http://www.emacswiki.org/emacs/PareditCheatsheet
Friday, December 4, 2009
stole from...


          ๏    http://mumble.net/~campbell/emacs/paredit.html
          ๏    http://p.hagelb.org/paredit-screencast.html
                           technomancy - screencast soon?




Friday, December 4, 2009
consume these...

          ๏    http://www.emacswiki.org/emacs/ParEdit
          ๏    http://steve.yegge.googlepages.com/effective-emacs
          ๏    Peepcode: Meet Emacs
                     ๏     http://peepcode.com/products/meet-emacs

          ๏    Peepcode: Functional Programming with Clojure
                     ๏     http://peepcode.com/products/functional-programming-with-clojure




Friday, December 4, 2009
images and food...
          ๏ Pretzels - http://www.flickr.com/photos/bellalago/3938498023/
          ๏ XKCD “Lisp Cycles” - http://xkcd.com/297/
          ๏ XKCD “Lisp” - http://xkcd.com/224/
          ๏ XKCD “Real Programmers” - http://xkcd.com/378/
          ๏ Obligatory LOLCAT - http://www.flickr.com/photos/nickporjr/2158780350/
          ๏ http://www.emacswiki.org/emacs/PareditCheatsheet
          ๏ thanks to runa, for the food




                                 http://bitterfilms.shop.musictoday.com/Product.aspx?pc=8BCT06#
Friday, December 4, 2009

More Related Content

Viewers also liked (20)

本格的に始めるzsh
本格的に始めるzsh本格的に始めるzsh
本格的に始めるzsh
Hideaki Miyake
 
Ruby1.9のfiberのかっこいい使い方
Ruby1.9のfiberのかっこいい使い方Ruby1.9のfiberのかっこいい使い方
Ruby1.9のfiberのかっこいい使い方
Kindai University
 
いまさら聞けないDocker - 第5回コンテナ型仮想化の情報交換会@大阪
いまさら聞けないDocker - 第5回コンテナ型仮想化の情報交換会@大阪いまさら聞けないDocker - 第5回コンテナ型仮想化の情報交換会@大阪
いまさら聞けないDocker - 第5回コンテナ型仮想化の情報交換会@大阪
Kunihiro TANAKA
 
プログラマとして仕事をするために勉強すること
プログラマとして仕事をするために勉強することプログラマとして仕事をするために勉強すること
プログラマとして仕事をするために勉強すること
なおき きしだ
 
Project Lambdaの基礎
Project Lambdaの基礎Project Lambdaの基礎
Project Lambdaの基礎
Yuichi Sakuraba
 
Code as data as code.
Code as data as code.Code as data as code.
Code as data as code.
Mike Fogus
 
受託開発時におけるAWSクラウド活用術
受託開発時におけるAWSクラウド活用術受託開発時におけるAWSクラウド活用術
受託開発時におけるAWSクラウド活用術
Hiroshi Koyama
 
ARC環境で メモリリークを起こす 7つの方法
ARC環境で メモリリークを起こす 7つの方法ARC環境で メモリリークを起こす 7つの方法
ARC環境で メモリリークを起こす 7つの方法
ushiostarfish _
 
ES6 at PayPal
ES6 at PayPalES6 at PayPal
ES6 at PayPal
Jamund Ferguson
 
Eclipse活用術
Eclipse活用術Eclipse活用術
Eclipse活用術
Masahiro Wakame
 
Storm Anatomy
Storm AnatomyStorm Anatomy
Storm Anatomy
Eiichiro Uchiumi
 
Closure CompilerのES6対応 あるいはES6時代のAltJS生存戦略
Closure CompilerのES6対応 あるいはES6時代のAltJS生存戦略Closure CompilerのES6対応 あるいはES6時代のAltJS生存戦略
Closure CompilerのES6対応 あるいはES6時代のAltJS生存戦略
Teppei Sato
 
ChefConf 2013: Beginner Chef Antipatterns
ChefConf 2013: Beginner Chef AntipatternsChefConf 2013: Beginner Chef Antipatterns
ChefConf 2013: Beginner Chef Antipatterns
Julian Dunn
 
Mobage を支える Ruby の技術 ~ 複数DB編 ~
Mobage を支える Ruby の技術 ~ 複数DB編 ~Mobage を支える Ruby の技術 ~ 複数DB編 ~
Mobage を支える Ruby の技術 ~ 複数DB編 ~
Naotoshi Seo
 
Scala 初めての人が Heroku で Web アプリを公開するまで
Scala 初めての人が Heroku で Web アプリを公開するまでScala 初めての人が Heroku で Web アプリを公開するまで
Scala 初めての人が Heroku で Web アプリを公開するまで
Hideaki Miyake
 
Build Your Own SaaS using Docker
Build Your Own SaaS using DockerBuild Your Own SaaS using Docker
Build Your Own SaaS using Docker
Julien Barbier
 
Purely Functional Data Structures in Scala
Purely Functional Data Structures in ScalaPurely Functional Data Structures in Scala
Purely Functional Data Structures in Scala
Vladimir Kostyukov
 
かなりすごい発表(かなり) at VimConf2014
かなりすごい発表(かなり) at VimConf2014かなりすごい発表(かなり) at VimConf2014
かなりすごい発表(かなり) at VimConf2014
Sugoi Kanari
 
From a monolithic Ruby on Rails app to the JVM
From a monolithic  Ruby on Rails app  to the JVMFrom a monolithic  Ruby on Rails app  to the JVM
From a monolithic Ruby on Rails app to the JVM
Phil Calçado
 
Rubyからscalaに変えるべき15の理由
Rubyからscalaに変えるべき15の理由Rubyからscalaに変えるべき15の理由
Rubyからscalaに変えるべき15の理由
Yukishige Nakajo
 
本格的に始めるzsh
本格的に始めるzsh本格的に始めるzsh
本格的に始めるzsh
Hideaki Miyake
 
Ruby1.9のfiberのかっこいい使い方
Ruby1.9のfiberのかっこいい使い方Ruby1.9のfiberのかっこいい使い方
Ruby1.9のfiberのかっこいい使い方
Kindai University
 
いまさら聞けないDocker - 第5回コンテナ型仮想化の情報交換会@大阪
いまさら聞けないDocker - 第5回コンテナ型仮想化の情報交換会@大阪いまさら聞けないDocker - 第5回コンテナ型仮想化の情報交換会@大阪
いまさら聞けないDocker - 第5回コンテナ型仮想化の情報交換会@大阪
Kunihiro TANAKA
 
プログラマとして仕事をするために勉強すること
プログラマとして仕事をするために勉強することプログラマとして仕事をするために勉強すること
プログラマとして仕事をするために勉強すること
なおき きしだ
 
Code as data as code.
Code as data as code.Code as data as code.
Code as data as code.
Mike Fogus
 
受託開発時におけるAWSクラウド活用術
受託開発時におけるAWSクラウド活用術受託開発時におけるAWSクラウド活用術
受託開発時におけるAWSクラウド活用術
Hiroshi Koyama
 
ARC環境で メモリリークを起こす 7つの方法
ARC環境で メモリリークを起こす 7つの方法ARC環境で メモリリークを起こす 7つの方法
ARC環境で メモリリークを起こす 7つの方法
ushiostarfish _
 
Closure CompilerのES6対応 あるいはES6時代のAltJS生存戦略
Closure CompilerのES6対応 あるいはES6時代のAltJS生存戦略Closure CompilerのES6対応 あるいはES6時代のAltJS生存戦略
Closure CompilerのES6対応 あるいはES6時代のAltJS生存戦略
Teppei Sato
 
ChefConf 2013: Beginner Chef Antipatterns
ChefConf 2013: Beginner Chef AntipatternsChefConf 2013: Beginner Chef Antipatterns
ChefConf 2013: Beginner Chef Antipatterns
Julian Dunn
 
Mobage を支える Ruby の技術 ~ 複数DB編 ~
Mobage を支える Ruby の技術 ~ 複数DB編 ~Mobage を支える Ruby の技術 ~ 複数DB編 ~
Mobage を支える Ruby の技術 ~ 複数DB編 ~
Naotoshi Seo
 
Scala 初めての人が Heroku で Web アプリを公開するまで
Scala 初めての人が Heroku で Web アプリを公開するまでScala 初めての人が Heroku で Web アプリを公開するまで
Scala 初めての人が Heroku で Web アプリを公開するまで
Hideaki Miyake
 
Build Your Own SaaS using Docker
Build Your Own SaaS using DockerBuild Your Own SaaS using Docker
Build Your Own SaaS using Docker
Julien Barbier
 
Purely Functional Data Structures in Scala
Purely Functional Data Structures in ScalaPurely Functional Data Structures in Scala
Purely Functional Data Structures in Scala
Vladimir Kostyukov
 
かなりすごい発表(かなり) at VimConf2014
かなりすごい発表(かなり) at VimConf2014かなりすごい発表(かなり) at VimConf2014
かなりすごい発表(かなり) at VimConf2014
Sugoi Kanari
 
From a monolithic Ruby on Rails app to the JVM
From a monolithic  Ruby on Rails app  to the JVMFrom a monolithic  Ruby on Rails app  to the JVM
From a monolithic Ruby on Rails app to the JVM
Phil Calçado
 
Rubyからscalaに変えるべき15の理由
Rubyからscalaに変えるべき15の理由Rubyからscalaに変えるべき15の理由
Rubyからscalaに変えるべき15の理由
Yukishige Nakajo
 

Recently uploaded (20)

Why "Smart" AI Isn't Enough for Telecom Anymore
Why "Smart" AI Isn't Enough for Telecom AnymoreWhy "Smart" AI Isn't Enough for Telecom Anymore
Why "Smart" AI Isn't Enough for Telecom Anymore
Phoenix Intelligence
 
Rock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning JourneyRock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning Journey
Lynda Kane
 
Collab Space by SIB (Simple Is Beautiful)
Collab Space by SIB (Simple Is Beautiful)Collab Space by SIB (Simple Is Beautiful)
Collab Space by SIB (Simple Is Beautiful)
SipkyJayaPutra
 
MAIA Knowledge Tools Launch Event.pptx.pdf
MAIA Knowledge Tools Launch Event.pptx.pdfMAIA Knowledge Tools Launch Event.pptx.pdf
MAIA Knowledge Tools Launch Event.pptx.pdf
weADAPT
 
"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko
Fwdays
 
Image processinglab image processing image processing
Image processinglab image processing  image processingImage processinglab image processing  image processing
Image processinglab image processing image processing
RaghadHany
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Powering a Billion Dreams: Scaling Meesho’s E-commerce Revolution with Scylla...
Powering a Billion Dreams: Scaling Meesho’s E-commerce Revolution with Scylla...Powering a Billion Dreams: Scaling Meesho’s E-commerce Revolution with Scylla...
Powering a Billion Dreams: Scaling Meesho’s E-commerce Revolution with Scylla...
ScyllaDB
 
CPMN (Feb-25) - North Star framework (Louise May)
CPMN (Feb-25) - North Star framework (Louise May)CPMN (Feb-25) - North Star framework (Louise May)
CPMN (Feb-25) - North Star framework (Louise May)
Cambridge Product Management Network
 
Leading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael JidaelLeading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael Jidael
Michael Jidael
 
Top 10 Content Writing Services in 2025.pdf
Top 10 Content Writing Services in 2025.pdfTop 10 Content Writing Services in 2025.pdf
Top 10 Content Writing Services in 2025.pdf
BookWizard Co.
 
beginning_lambda_minimium_of_40_length.pptx
beginning_lambda_minimium_of_40_length.pptxbeginning_lambda_minimium_of_40_length.pptx
beginning_lambda_minimium_of_40_length.pptx
ShashankER1
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Presentation Session 5 Transition roadmap.pdf
Presentation Session 5 Transition roadmap.pdfPresentation Session 5 Transition roadmap.pdf
Presentation Session 5 Transition roadmap.pdf
Mukesh Kala
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
End-to-end process automation: Simplifying SAP master data with low-code/no-c...
End-to-end process automation: Simplifying SAP master data with low-code/no-c...End-to-end process automation: Simplifying SAP master data with low-code/no-c...
End-to-end process automation: Simplifying SAP master data with low-code/no-c...
Precisely
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
Lynda Kane
 
Why "Smart" AI Isn't Enough for Telecom Anymore
Why "Smart" AI Isn't Enough for Telecom AnymoreWhy "Smart" AI Isn't Enough for Telecom Anymore
Why "Smart" AI Isn't Enough for Telecom Anymore
Phoenix Intelligence
 
Rock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning JourneyRock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning Journey
Lynda Kane
 
Collab Space by SIB (Simple Is Beautiful)
Collab Space by SIB (Simple Is Beautiful)Collab Space by SIB (Simple Is Beautiful)
Collab Space by SIB (Simple Is Beautiful)
SipkyJayaPutra
 
MAIA Knowledge Tools Launch Event.pptx.pdf
MAIA Knowledge Tools Launch Event.pptx.pdfMAIA Knowledge Tools Launch Event.pptx.pdf
MAIA Knowledge Tools Launch Event.pptx.pdf
weADAPT
 
"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko
Fwdays
 
Image processinglab image processing image processing
Image processinglab image processing  image processingImage processinglab image processing  image processing
Image processinglab image processing image processing
RaghadHany
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Powering a Billion Dreams: Scaling Meesho’s E-commerce Revolution with Scylla...
Powering a Billion Dreams: Scaling Meesho’s E-commerce Revolution with Scylla...Powering a Billion Dreams: Scaling Meesho’s E-commerce Revolution with Scylla...
Powering a Billion Dreams: Scaling Meesho’s E-commerce Revolution with Scylla...
ScyllaDB
 
Leading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael JidaelLeading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael Jidael
Michael Jidael
 
Top 10 Content Writing Services in 2025.pdf
Top 10 Content Writing Services in 2025.pdfTop 10 Content Writing Services in 2025.pdf
Top 10 Content Writing Services in 2025.pdf
BookWizard Co.
 
beginning_lambda_minimium_of_40_length.pptx
beginning_lambda_minimium_of_40_length.pptxbeginning_lambda_minimium_of_40_length.pptx
beginning_lambda_minimium_of_40_length.pptx
ShashankER1
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Presentation Session 5 Transition roadmap.pdf
Presentation Session 5 Transition roadmap.pdfPresentation Session 5 Transition roadmap.pdf
Presentation Session 5 Transition roadmap.pdf
Mukesh Kala
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
End-to-end process automation: Simplifying SAP master data with low-code/no-c...
End-to-end process automation: Simplifying SAP master data with low-code/no-c...End-to-end process automation: Simplifying SAP master data with low-code/no-c...
End-to-end process automation: Simplifying SAP master data with low-code/no-c...
Precisely
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
Lynda Kane
 

Paredit Preso

  • 1. Bay Area Clojure Meetup functional lispers December 3, 2009 Runa Galactic Headquarters Friday, December 4, 2009
  • 2. paredit At first it sucks, but then it’s awesome. mudphone (kyle oba) irc / twitter / github runa employee 9 Friday, December 4, 2009
  • 3. about runa We are simultaneously the largest cloud-based manufacturer, distributor, and consumer of Bavarian-style pretzels, nationally. http://www.flickr.com/photos/bellalago/3938498023/ Friday, December 4, 2009
  • 4. and we’re hiring clojure-hbase-ruby-hadoop-rails-javascript-chefs Friday, December 4, 2009
  • 5. 0/8 why Friday, December 4, 2009
  • 6. Q: What is paredit? A: paredit is a minor mode for Emacs, created by Taylor R. Campbell. Friday, December 4, 2009
  • 7. commit 2ecf00a124062d7b4c4538f79426bc19c6b11b83 Author: Philip (flip) Kromer <fl[email protected]> Date: Mon Aug 24 23:38:14 2009 -0500 Paredit fucking sucks my balls So, why paredit? Friday, December 4, 2009
  • 8. Because, these are your father’s parentheses... http://xkcd.com/297/ Friday, December 4, 2009
  • 9. http://technomancy.us/126 Hingebjerg – 2009-06-01T14:05:40Z Hi Phil, Just installed the emacs-starter-kit and clojure-mode, and i can't delete curly braces when in clojure-mode. Is there a logical explanation for that? Phil – 2009-06-12T09:37:15Z Hingebjerg: That's a feature of paredit-mode; it enforces that you can't delete parens (or other matched chars) unless they're empty so you don't end up with invalid structure in your code. It's unbelievably handy/ addictive once you get used to it, but if you're not sure what's going on it can be pretty annoying. Friday, December 4, 2009
  • 10. 0/8 why 1/8 balancing 2/8 basic insertion commands 3/8 deleting & killing 4/8 movement & navigation 5/8 depth-changing commands 6/8 barfage & slurpage 7/8 miscellaneous commands 8/8 in the wild (tips & tricks) Friday, December 4, 2009
  • 11. 1/8 balancing Friday, December 4, 2009
  • 12. balancing basics keys ([“ ([“”]) Friday, December 4, 2009
  • 13. 1.1/8 assumptions Friday, December 4, 2009
  • 14. you’re using the emacs starter kit or, you’re already familiar setting the modes up you’ve got paredit and show-parens modes M-x paredit-mode M-x show-paren-mode Friday, December 4, 2009
  • 15. install? ;;; Install paredit by placing `paredit.el' in `/path/to/elisp', a ;;; directory of your choice, and adding to your .emacs file: ;;; ;;; (add-to-list 'load-path "/path/to/elisp") ;;; (autoload 'paredit-mode "paredit" ;;; "Minor mode for pseudo-structurally editing Lisp code." ;;; t) ;;; ;;; Toggle Paredit Mode with `M-x paredit-mode RET', or enable it ;;; always in a major mode `M' (e.g., `lisp' or `scheme') with: ;;; ;;; (add-hook M-mode-hook (lambda () (paredit-mode +1))) http://mumble.net/~campbell/emacs/paredit.el Friday, December 4, 2009
  • 16. wrapping killing raising splicing slurping / barfing 1.2/8 demo splitting / joining Friday, December 4, 2009
  • 17. 2/8 basic insertion commands Friday, December 4, 2009
  • 18. paredit-open-round keys (a b |c d) ( (a b (|) c d) Friday, December 4, 2009
  • 19. paredit-close-round-and-newline keys (a b |c ) ) (a b c) | Friday, December 4, 2009
  • 20. paredit-close-round keys (a b |c ) M-) (a b c)| Friday, December 4, 2009
  • 21. paredit-open-square keys (a b |c d) [ (a b [|] c) Friday, December 4, 2009
  • 22. paredit-close-square keys (defn cky [bcn| ] 2) ] (defn cky [bcn]| 2) Friday, December 4, 2009
  • 23. paredit-doublequote keys (ça va |bien) “ (ça va “|” bien) Friday, December 4, 2009
  • 24. paredit-doublequote (while in a quote) keys (the “q|uick” fox) “ (the “q”|uick” fox) Friday, December 4, 2009
  • 25. paredit-meta-doublequote keys (the |(cky) bcn) M-” (the “|(cky)” bcn) Friday, December 4, 2009
  • 26. paredit-meta-doublequote (while in quote) keys (the “chk|y” bcn) M-” (the “chky” |bcn) Friday, December 4, 2009
  • 27. paredit-comment-dwim keys (blah |xyz) ; baz M-; (blah xyz) ; |baz Friday, December 4, 2009
  • 28. paredit-comment-dwim keys (amit siva)| M-; (amit siva) ;| Friday, December 4, 2009
  • 29. paredit-comment-dwim (hbase) | keys (clojure) M-; (hbase) ;;; | (clojure) Friday, December 4, 2009
  • 30. paredit-comment-dwim (ruby) |(java) keys M-; (ruby) ;;; | (java) Friday, December 4, 2009
  • 31. paredit-newline keys (let [x 2] |(list x y) C-j (let [x 2] |(list x y)) Friday, December 4, 2009
  • 32. intermission http://xkcd.com/224/ Friday, December 4, 2009
  • 33. 3/8 deleting & killing Friday, December 4, 2009
  • 34. paredit-forward-delete (|”third” worst) keys (“|third” worst) C-d (“|hird” worst) Friday, December 4, 2009
  • 35. paredit-forward-delete (w |(x) y) keys (w (|x) y) C-d (w (|) y) (w | y) Friday, December 4, 2009
  • 36. paredit-backward-delete (“speed” w|alk) keys (“speed” |alk) DEL (“speed”|alk) (“speed|”alk) (“spee|”alk) Friday, December 4, 2009
  • 37. paredit-backward-delete (w (x)| y) keys (w (x|) y) DEL (w (|) y) (w | y) Friday, December 4, 2009
  • 38. paredit-kill keys (zee)| ;comment C-k (zee)| Friday, December 4, 2009
  • 39. paredit-kill (|zee) ;comment keys (|) ;comment C-k (println “|x is:” x) (println “|” x) Friday, December 4, 2009
  • 40. paredit-forward-kill-word |(declare x) ;comment keys (| x) ;comment M-d (|) ;comment () ;| Friday, December 4, 2009
  • 41. paredit-forward-kill-word ;| hack (declare x) keys ;| M-d (declare x) ; (| x) Friday, December 4, 2009
  • 42. paredit-backward-kill-word (declare x) ;comment (zee) | keys (declare x) ;comment M-DEL (|) (declare x) ;| Friday, December 4, 2009
  • 43. paredit-backward-kill-word keys (declare x) ;| M-DEL (declare |) (|) Friday, December 4, 2009
  • 44. 4/8 movement & navigation Friday, December 4, 2009
  • 45. paredit-forward keys (conj |[1 2 3] 4) C-M-f (conj [1 2 3]| 4) Friday, December 4, 2009
  • 46. paredit-forward keys (conj [1 2 3] |4) C-M-f (conj [1 2 3] 4|) (conj [1 2 3] 4)| Friday, December 4, 2009
  • 47. paredit-backward keys (conj [1 2 3]| 4) C-M-b (conj |[1 2 3] 4) Friday, December 4, 2009
  • 48. paredit-backward keys (conj| [1 2 3] 4) C-M-b (|conj [1 2 3] 4) |(conj [1 2 3] 4) Friday, December 4, 2009
  • 49. intermission http://www.flickr.com/photos/nickporjr/2158780350/ Friday, December 4, 2009
  • 50. 5/8 depth-changing commands Friday, December 4, 2009
  • 51. paredit-wrap-around keys (eat |cky bcn) M-( (eat (|cky) bcn) same for {}, [], and “” Friday, December 4, 2009
  • 52. paredit-splice-sexp keys (eat (|cky bcn) sdwch) M-s (eat |cky bcn sdwch) Friday, December 4, 2009
  • 53. paredit-splice-sexp-killing-backward keys (eat (cky |bcn)) M-<up> (eat |bcn) Friday, December 4, 2009
  • 54. paredit-splice-sexp-killing-forward keys (eat (cky |bcn)) M-<down> (eat cky|) Friday, December 4, 2009
  • 55. paredit-raise-sexp keys (eat (cky |bcn) sdwch) M-r (eat |bcn sdwch) |bcn Friday, December 4, 2009
  • 56. 6/8 barfage & slurpage Friday, December 4, 2009
  • 57. paredit-forward-slurp-sexp keys (eat (|cky) bcn z) C-) C-<right> (eat (|cky bcn) z) Friday, December 4, 2009
  • 58. paredit-forward-barf-sexp keys (eat (|cky bcn) z) C-} C-<left> (eat (|cky) bcn z) Friday, December 4, 2009
  • 59. paredit-backward-slurp-sexp keys C-( (omg eat (|cky) bcn) C-M-<left> (omg (eat |cky) bcn) Friday, December 4, 2009
  • 60. paredit-backward-barf-sexp keys C-{ (omg (eat |cky) bcn) C-M-<right> (omg eat (|cky) bcn) Friday, December 4, 2009
  • 61. 7/8 miscellaneous commands Friday, December 4, 2009
  • 62. paredit-split-sexp keys (cky |bcn) M-S-s (cky) |(bcn) same for {}, [], and “” Friday, December 4, 2009
  • 63. paredit-join-sexps (cky)| (bcn) (cky| bcn) keys chunky- M-S-j | bacon chunky-|bacon same for {}, [], and “” Friday, December 4, 2009
  • 66. 8/8 in the wild (tips and tricks) Friday, December 4, 2009
  • 67. C-w is not a paredit thing show-paren-mode warning 8.1/8 demo fixing unbalanced parens Friday, December 4, 2009
  • 68. add parens when unbalanced (override matched keys w/ C-q) keys (important | C-q ) (important )| same for {}, [], and “” Friday, December 4, 2009
  • 69. remove pesky spaces (important | ) keys (important C-k then |) <del> (important |) Friday, December 4, 2009
  • 70. remove stray parens with comments poor paren)| keys poor paren|) DEL then ; then poor paren;|) C-d poor paren;| Friday, December 4, 2009
  • 71. override paredit delete keys C-u DEL C-u C-d LTR C-u C-k Friday, December 4, 2009
  • 72. remove stray parens probably the right way keys poor paren)| C-u DEL poor paren| Friday, December 4, 2009
  • 73. dammit, emacs keys M-x butterfly LTR Friday, December 4, 2009
  • 74. M-x butterfly http://xkcd.com/378/ Friday, December 4, 2009
  • 75. add paredit to the SLIME REPL ;; enable paredit in slime repl (add-hook 'slime-repl-mode-hook (lambda () (paredit-mode +1))) Karol Skocik - http://coding.derkeiler.com/Archive/Lisp/comp.lang.lisp/2007-07/ Friday, December 4, 2009
  • 76. customize ;;; Customize paredit using `eval-after-load': ;;; ;;; (eval-after-load 'paredit ;;; '(progn ...redefine keys, &c....)) ;;; ;;; ... Now `)' is bound to a ;;; command that does not insert a newline, and `M-)' is bound to the ;;; command that inserts a newline. To revert to the former behaviour, ;;; add the following forms to an `eval-after-load' form for paredit.el ;;; in your .emacs file: ;;; ;;; (define-key paredit-mode-map (kbd ")") ;;; 'paredit-close-round-and-newline) ;;; (define-key paredit-mode-map (kbd "M-)") ;;; 'paredit-close-round) http://mumble.net/~campbell/emacs/paredit.el Friday, December 4, 2009
  • 78. stole from... ๏ http://mumble.net/~campbell/emacs/paredit.html ๏ http://p.hagelb.org/paredit-screencast.html technomancy - screencast soon? Friday, December 4, 2009
  • 79. consume these... ๏ http://www.emacswiki.org/emacs/ParEdit ๏ http://steve.yegge.googlepages.com/effective-emacs ๏ Peepcode: Meet Emacs ๏ http://peepcode.com/products/meet-emacs ๏ Peepcode: Functional Programming with Clojure ๏ http://peepcode.com/products/functional-programming-with-clojure Friday, December 4, 2009
  • 80. images and food... ๏ Pretzels - http://www.flickr.com/photos/bellalago/3938498023/ ๏ XKCD “Lisp Cycles” - http://xkcd.com/297/ ๏ XKCD “Lisp” - http://xkcd.com/224/ ๏ XKCD “Real Programmers” - http://xkcd.com/378/ ๏ Obligatory LOLCAT - http://www.flickr.com/photos/nickporjr/2158780350/ ๏ http://www.emacswiki.org/emacs/PareditCheatsheet ๏ thanks to runa, for the food http://bitterfilms.shop.musictoday.com/Product.aspx?pc=8BCT06# Friday, December 4, 2009