Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing SBCL options to slime?

How do I increase the stack size in a slime session.

I can do it in the terminal with:

$> sbcl --control-stack-size 5

How do I do this in slime?

like image 795
Vinn Avatar asked Oct 25 '25 01:10

Vinn


1 Answers

In your emacs init.el or .emacs file you can include program arguments in the settings of slime-lisp-implementations. For example:

;; Set available Lisp implementations
(setq slime-lisp-implementations
      '((sbcl ("/usr/local/bin/sbcl" "--control-stack-size" "5"))
        (cmucl ("lisp"))
        (ccl ("ccl64"))
        (clisp ("clisp"))))

Responding to an OP comment:

... will the new stack size hold if I create an executable?

That depends on how you create the executable. You can't use save-lisp-and-die from a Slime repl, but you can use it from an SBCL repl. You can use the :save-runtime-options key argument which saves the --dynamic-space-size and --control-stack-size runtime options. E.g., you could do this from a terminal window to create an executable named my-exe with a custom control stack size:

$ sbcl --control-stack-size 5                         \
>      --load "my-source-file.lisp"                   \
>      --eval "(sb-ext:save-lisp-and-die #p\"my-exe\" \
>               :toplevel #'main                      \
>               :executable t                         \
>               :save-runtime-options t)"             \
>      --eval "(quit)"
like image 138
ad absurdum Avatar answered Oct 27 '25 01:10

ad absurdum



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!