SLIME The Superior Lisp Interaction Mode for Emacs An Introduction -- Chaitanya Gupta
Common Lisp: Syntax No Syntax Well, actually there is, but...
Common Lisp: Syntax Prefix Notation (operator arg1 arg2 ...) A List  (Lisp == LISt Processor)
CL Examples <ul><ul><li>Arithmetic operations (+ 4 5 6) => 15 (* 10 20) => 200 (/ 60 9)  => 20/3 </li></ul></ul><ul><ul><l...
CL Examples <ul><ul><li>Strings (length “foobar”) => 6 (string-upcase “quux”) => “QUUX” </li></ul></ul><ul><ul><li>Assignm...
CL Examples <ul><ul><li>Flow Control (if (< x y)   (print “foo”)   (print “bar”)) </li></ul></ul><ul><ul><li>Iteration (do...
CL Examples <ul><ul><li>Functions (defun factorial (n)   (if (<= n 1)   1   (* n (factorial (1- n))))) (factorial 0) => 1 ...
The REPL Read Eval Print Loop
Architecture SLIME SWANK Client Server Emacs SBCL, CMUCL, CLISP, etc.
Evaluation <ul><li>C-x C-e M-x slime-eval-last-expression </li></ul><ul><li>C-M-x M-x slime-eval-last-defun </li></ul><ul>...
Compilation <ul><li>C-c C-c M-x slime-compile-defun </li></ul><ul><li>C-c C-k M-x slime-compile-and-load-file </li></ul><u...
Completion <ul><li>TAB M-x slime-complete-symbol </li></ul><ul><li>M-TAB M-x slime-fuzzy-complete-symbol </li></ul>
Documentation <ul><li>SPC M-x slime-space </li></ul><ul><li>C-c C-d d M-x slime-describe-symbol </li></ul><ul><li>C-c C-d ...
Finding Definitions <ul><li>M-. M-x slime-edit-definition </li></ul><ul><li>M-, M-* M-x slime-pop-find-definition-stack </...
Inspector <ul><li>C-c I M-x slime-inspect </li></ul><ul><li>Some Inspector commands </li></ul><ul><ul><li>RET M-x slime-in...
Cross-reference <ul><li>C-c C-w c M-x slime-who-calls </li></ul><ul><li>C-c C-w w M-x slime-calls-who </li></ul><ul><li>C-...
Disassembly <ul><li>C-c M-d M-x slime-disassemble-symbol </li></ul><ul><li>C-c C-t M-x slime-toggle-trace-definition </li>...
SLDB: the SLIME debugger <ul><li>Examining Frames </li></ul><ul><ul><li>t M-x sldb-toggle-details </li></ul></ul><ul><ul><...
SLDB: the SLIME debugger <ul><li>Frame Navigation </li></ul><ul><ul><li>n M-x sldb-down </li></ul></ul><ul><ul><li>p M-x s...
SLDB: the SLIME debugger <ul><li>Miscellaneous commands </li></ul><ul><ul><li>r M-x sldb-restart-frame </li></ul></ul><ul>...
How CL helps <ul><li>eval </li></ul><ul><li>compile, compile-file, load </li></ul><ul><li>describe, documentation </li></u...
CL Resources <ul><li>Lisp implementations </li></ul><ul><ul><li>SBCL --  http://www.sbcl.org/ </li></ul></ul><ul><ul><li>C...
CL Resources <ul><li>Emacs --  http://www.gnu.org/software/emacs/ </li></ul><ul><li>SLIME --  http://common-lisp.net/proje...
CL Resources <ul><li>Books </li></ul><ul><ul><li>Practical Common Lisp (by Peter Seibel) http://www.gigamonkeys.com/book/ ...
CL Resources <ul><li>CL Tutorials </li></ul><ul><ul><li>Casting SPELs in Lisp http://www.lisperati.com/casting.html </li><...
Upcoming SlideShare
Loading in …5
×

SLIME

7,996 views
7,908 views

Published on

An introduction to SLIME, the Superior Lisp Interaction Mode for Emacs.

This talk was given at ILUGD, March 2009 meeting at JNU, New Delhi.

The same talk was given a week later at OSSCamp, held at IIT Delhi on March 29.

Published in: Technology, Education
1 Comment
5 Likes
Statistics
Notes
No Downloads
Views
Total views
7,996
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
64
Comments
1
Likes
5
Embeds 0
No embeds

No notes for slide

SLIME

  1. 1. SLIME The Superior Lisp Interaction Mode for Emacs An Introduction -- Chaitanya Gupta
  2. 2. Common Lisp: Syntax No Syntax Well, actually there is, but...
  3. 3. Common Lisp: Syntax Prefix Notation (operator arg1 arg2 ...) A List (Lisp == LISt Processor)
  4. 4. CL Examples <ul><ul><li>Arithmetic operations (+ 4 5 6) => 15 (* 10 20) => 200 (/ 60 9) => 20/3 </li></ul></ul><ul><ul><li>Comparisons (= 5 5) => T (<= 10 5) => NIL </li></ul></ul>
  5. 5. CL Examples <ul><ul><li>Strings (length “foobar”) => 6 (string-upcase “quux”) => “QUUX” </li></ul></ul><ul><ul><li>Assignment (setf x 9) => 9 (setf y (+ x 10)) => 19 </li></ul></ul>
  6. 6. CL Examples <ul><ul><li>Flow Control (if (< x y) (print “foo”) (print “bar”)) </li></ul></ul><ul><ul><li>Iteration (dotimes (i 10) (print “Hello World!”)) </li></ul></ul>
  7. 7. CL Examples <ul><ul><li>Functions (defun factorial (n) (if (<= n 1) 1 (* n (factorial (1- n))))) (factorial 0) => 1 (factorial 5) => 120 </li></ul></ul>
  8. 8. The REPL Read Eval Print Loop
  9. 9. Architecture SLIME SWANK Client Server Emacs SBCL, CMUCL, CLISP, etc.
  10. 10. Evaluation <ul><li>C-x C-e M-x slime-eval-last-expression </li></ul><ul><li>C-M-x M-x slime-eval-last-defun </li></ul><ul><li>C-c C-r M-x slime-eval-region </li></ul>
  11. 11. Compilation <ul><li>C-c C-c M-x slime-compile-defun </li></ul><ul><li>C-c C-k M-x slime-compile-and-load-file </li></ul><ul><li>M-n M-x slime-next-note </li></ul><ul><li>M-p M-x slime-previous-note </li></ul>
  12. 12. Completion <ul><li>TAB M-x slime-complete-symbol </li></ul><ul><li>M-TAB M-x slime-fuzzy-complete-symbol </li></ul>
  13. 13. Documentation <ul><li>SPC M-x slime-space </li></ul><ul><li>C-c C-d d M-x slime-describe-symbol </li></ul><ul><li>C-c C-d a M-x slime-apropos </li></ul><ul><li>C-c C-d h M-x slime-hyperspec-lookup </li></ul>
  14. 14. Finding Definitions <ul><li>M-. M-x slime-edit-definition </li></ul><ul><li>M-, M-* M-x slime-pop-find-definition-stack </li></ul><ul><li>(the “Meta-point” commands) </li></ul>
  15. 15. Inspector <ul><li>C-c I M-x slime-inspect </li></ul><ul><li>Some Inspector commands </li></ul><ul><ul><li>RET M-x slime-inspector-operate-on-point </li></ul></ul><ul><ul><li>l M-x slime-inspector-pop </li></ul></ul><ul><ul><li>n M-x slime-inspector-next </li></ul></ul><ul><ul><li>M-RET M-x slime-inspector-copy-down </li></ul></ul>
  16. 16. Cross-reference <ul><li>C-c C-w c M-x slime-who-calls </li></ul><ul><li>C-c C-w w M-x slime-calls-who </li></ul><ul><li>C-c C-w r M-x slime-who-references </li></ul><ul><li>C-c C-w b M-x slime-who-binds </li></ul><ul><li>C-c C-w s M-x slime-who-sets </li></ul>
  17. 17. Disassembly <ul><li>C-c M-d M-x slime-disassemble-symbol </li></ul><ul><li>C-c C-t M-x slime-toggle-trace-definition </li></ul><ul><li>M-x slime-untrace-all </li></ul>
  18. 18. SLDB: the SLIME debugger <ul><li>Examining Frames </li></ul><ul><ul><li>t M-x sldb-toggle-details </li></ul></ul><ul><ul><li>v M-x sldb-show-source </li></ul></ul><ul><ul><li>e M-x sldb-eval-in-frame </li></ul></ul><ul><ul><li>i M-x sldb-inspect-in-frame </li></ul></ul>
  19. 19. SLDB: the SLIME debugger <ul><li>Frame Navigation </li></ul><ul><ul><li>n M-x sldb-down </li></ul></ul><ul><ul><li>p M-x sldb-up </li></ul></ul><ul><ul><li>M-n M-x sldb-details-down </li></ul></ul><ul><ul><li>M-p M-x sldb-details-up </li></ul></ul>
  20. 20. SLDB: the SLIME debugger <ul><li>Miscellaneous commands </li></ul><ul><ul><li>r M-x sldb-restart-frame </li></ul></ul><ul><ul><li>R M-x sldb-return-from-frame </li></ul></ul><ul><ul><li>C M-x sldb-inspect-condition </li></ul></ul><ul><ul><li>q M-x sldb-quit </li></ul></ul>
  21. 21. How CL helps <ul><li>eval </li></ul><ul><li>compile, compile-file, load </li></ul><ul><li>describe, documentation </li></ul><ul><li>apropos </li></ul><ul><li>sb-introspect:who-calls, sb-introspect:who-references, etc. </li></ul><ul><li>disassemble </li></ul><ul><li>trace, step </li></ul><ul><li>inspect </li></ul>
  22. 22. CL Resources <ul><li>Lisp implementations </li></ul><ul><ul><li>SBCL -- http://www.sbcl.org/ </li></ul></ul><ul><ul><li>CMUCL -- http://www.cons.org/cmucl/ </li></ul></ul><ul><ul><li>CLISP -- http://clisp.cons.org/ </li></ul></ul><ul><ul><li>Clozure CL -- http://www.clozure.com/clozurecl.html </li></ul></ul><ul><ul><li>AllegroCL (commercial) -- http://www.franz.com </li></ul></ul><ul><ul><li>Lispworks (commercial) -- http://www.lispworks.com/ </li></ul></ul><ul><ul><li>Scineer CL (commercial) -- http://www.scieneer.com/scl/ </li></ul></ul><ul><ul><li>and more ... </li></ul></ul>
  23. 23. CL Resources <ul><li>Emacs -- http://www.gnu.org/software/emacs/ </li></ul><ul><li>SLIME -- http://common-lisp.net/project/slime/ </li></ul><ul><li>Paredit -- http://mumble.net/~campbell/emacs/paredit.el </li></ul>
  24. 24. CL Resources <ul><li>Books </li></ul><ul><ul><li>Practical Common Lisp (by Peter Seibel) http://www.gigamonkeys.com/book/ </li></ul></ul><ul><ul><li>Common Lisp: A Gentle Introduction to Symbolic Computation http://www-cgi.cs.cmu.edu/afs/cs.cmu.edu/user/dst/www/LispBook/index.html </li></ul></ul><ul><ul><li>On Lisp (by Paul Graham) http://www.paulgraham.com/onlisp.html </li></ul></ul><ul><ul><li>Paradigms of AI Programming: Case Studies in Common Lisp (by Peter Norvig) http://norvig.com/paip.html </li></ul></ul><ul><ul><li>Structure and Interpretation of Computer Programs (by Harold Abelson and Gerald Jay Sussman with Julie Sussman) http://mitpress.mit.edu/sicp/ </li></ul></ul>
  25. 25. CL Resources <ul><li>CL Tutorials </li></ul><ul><ul><li>Casting SPELs in Lisp http://www.lisperati.com/casting.html </li></ul></ul><ul><ul><li>A Tutorial on Conditions and Restarts http://chaitanyagupta.com/lisp/restarts.html </li></ul></ul><ul><ul><li>Lisp for the Web http://www.adampetersen.se/articles/lispweb.htm </li></ul></ul>

×