Friday, February 27, 2015

how slime enables debug info in sbcl

This is a copy-and-paste of an old Reddit post of mine.

Hello,

Peter Keller (psilord) and I were talking about debugging CL and it prompted me to take a quick tour of how SLIME enables debug compilation for SBCL. This appears to be the general flow:
  1. C-u C-c C-k calls slime-compile-and-load-file (slime.el) with the default argument of 4. The default of 4 threw me. I don't know the history behind that.
  2. slime-compile-and-load-file (slime.el) generates a compute policy of '(cl:debug . 3)
  3. slime-compile-and-load-file (slime.el) calls slime-compile-file (slime.el) with arguments of (t '(cl:debug . 3))
  4. slime-compile-file (slime.el) calls the CL function swank:compile-file-for-emacs (swank.lisp)
  5. compile-file-for-emacs (swank.lisp) calls swank-compile-file* (swank.lisp)
  6. swank-compile-file* (swank.lisp) calls swank-compile-file (swank-sbcl.lisp)
  7. swank-compile-file (swank-sbcl.lisp) calls compiler-policy (swank-sbcl.lisp)
  8. compiler-policy (swank-sbcl.lisp) calls (sb-ext:restrict-compiler-policy 'cl:debug 3)
References:

Sunday, February 22, 2015

Using LaTeX on FreeBSD

I've been using FreeBSD 10.1 on my laptop and had to relearn how to do some basic things in LaTeX. First of all, tetex is no longer a distribution that is used; look for "texlive" when installing. Secondly, I could not remember how to add local packages to my hash. After dusting many cobwebs, it appears to be the following:
  1. mkdir -p ~/texmf/tex/latex
  2. cp whatever.cls ~/texmf/tex/latex
  3. texhash