lisp-tips icon indicating copy to clipboard operation
lisp-tips copied to clipboard

Common Lisp tips. Share !

Results 54 lisp-tips issues
Sort by recently updated
recently updated
newest added

I wanted to print the symbols of a package that are not exported: the internal symbols. ```lisp (defun internal-symbol-p (symbol) (equal :internal (nth-value 1 (find-symbol (string symbol))))) ``` indeed, `find-symbol`...

packages
macros

Usually, to save a lisp image, we must call SBCL from the terminal and call save-lisp-and-die from there. If we attempt to do it from the Slime REPL, we get...

slime
repl
executables
sly

```lisp (remove-if-not (lambda (x) (typep x 'asdf:static-file)) (asdf:component-children (asdf:find-system "alexandria"))) ;; => (#) (inspect (first *)) ;; => The object is a STANDARD-OBJECT of type ASDF/COMPONENT:STATIC-FILE. 0. NAME: "README.markdown" 1....

asdf

Usually the compiler will optimize things out and this will reduce the amount of information available to the debugger. For example sometimes we can’t see intermediate variables of computations. You...

slime

If you redefine a macro, the macro call sites need all to be updated. Thankfully, with SLIME / SLY you don't have to do it manually as explained [here](https://40ants.com/tips.html). Press...

slime
macros

After a SLY sticker has collected recordings (e.g. call `sly-stickers-fetch` with `C-c C-s S`, the sticker turns green by default), there are multiple actions you can take: - Hover with...

clos
repl
sly

Since SLY mrepl is based on Emacs' `comint-mode`, it supports file completion out of the box: just press `TAB` within a string that starts with a relative or absolute path....

repl
sly

With SLY, you can customize the following setting: ```elisp (setq sly-connection-update-interval 0.1) ``` Note that too low a value may not work for all setups, see the docstring for more...

repl
sly

You can edit a setf-able symbol with `C-c E` (`sly-edit-value` or `slime-edit-value`): it pops up a new buffer with the current value of the symbol. Edit it and press `C-c...

slime
repl

An asd declaration accepts a `:version`: ``` (asdf:defsystem "myapp" :version "0.1.1" ``` How can we get it programmatically? ```lisp (asdf/component:component-version (asdf:find-system :myapp)) ;; "0.1.1" ``` We can also append the...

asdf