There are two means of automatic initialization of CLOS slot values, :initform and :default-initargs. Chris Riesbeck makes a strong case for preferring :default-initargs.
Here’s a simplified example of the syntactic difference, taken from some Quicklisp code. Consider modeling version control…
After updating Slime it’s usually needed to restart Emacs so that the changes take effect, but restarting Emacs is quite inconvenient. After adding the following code into .emacs, M-x restart-slime will reload all the Emacs Lisp parts (CL side should be restarted with ,restart short-cut in the…
parse-integer takes :start and :end arguments, so you don’t have to extract integer subsequences from strings to pass them to parse-integer. For example, to parse date strings that look like “2011-10-01” into year, month, and date integers, you can do this:(defun parse-date (string) "Parse a...
M-x slime-list-threads (you can also access it through slime-selector shortcut t) will list running threads by their names, and their statuses.
The thread on the current line can be killed with k, or if there’s a lot of threads to kill, several lines can be selected and k will kill all the…
Slime has a nice cross referencing facility, for example, you can see what calls a particular function or expands a macro.
It presents a list of places which reference a particular entity, from there you can recompile the thing which references by pressing C-c C-c on that line. C-c C-k will…
M-x slime-format-string-expand: expands the format control string at point.
”~a, ~a.” on SBCL yields#'(LAMBDA (STREAM &OPTIONAL (#:FORMAT-ARG1502 (ERROR 'SB-FORMAT:FORMAT-ERROR :COMPLAINT "required argument missing" :CONTROL-STRING "~a, ~a." :OFFSET 1)) (#:FORMAT-ARG1503 (ERROR...
Slime has many buffers, and sometimes it’s not easy navigating between them, slime-selector simplifies this task.
It’s not bound to any key by default, I bind it globally to C-z(global-set-key "\C-z" 'slime-selector)
Then it allows you to select a buffer by a letter.
Some of the most useful shortcuts are listed here, the full list can be seen by pressing “?”.
- r Current active REPL
- l Most recently visited lisp file
- d Debugger
- c List of implementations slime is connected to
- t Threads list
- i *inferior-lisp* buffer
- s *slime-scratch* buffer (for writing one-off code)
- v Log of slime events (useful for debugging Slime problems)