Slime Tips

Little known features of Slime.

2 notes &

Exporting symbols

C-c x (slime-export-symbol-at-point) from slime-package-fu contrib: takes the symbol at point and modifies
the :export clause of the corresponding defpackage form. It also exports the symbol.
When called with a negative argument (C-u C-c x) it will remove the symbol from :export and unexport it.

M-x slime-export-class does the same but with symbols defined
by a structure or a class, like accesors, constructors, and so on.
It works on structures only on SBCL and Clozure CL so far.
Classes should work everywhere with MOP.

There are different styles of how symbols are presented in DEFPACKAGE, the default is to use uninterned symbols (#:foo).
This can be changed:

to use keywords:

(setq slime-export-symbol-representation-function
      (lambda (n) (format ":%s" n)))

or strings:

(setq slime-export-symbol-representation-function

 (lambda (n) (format "\"%s\"" (upcase n))))
  1. slime-tips posted this