SLIME and in-package

Stas Boukarev stassats at gmail.com
Sat Feb 6 11:08:30 UTC 2016


Just do C-c ~ and the REPL package will be changed.

On Sat, Feb 6, 2016 at 10:39 AM, Peter Keller <psilord at cs.wisc.edu> wrote:
> Hello,
>
> I have a question, hopefully easy, but I can't seem to find the answer.
>
> I'd like to evaluate a region which contains something like this:
>
> (asdf:load-system '#:foo)
> (in-package #'foo)
>
> and have my slime REPL actually change its current package.
>
> I realize that some problems can happen with the above, which led me
> to this page:
>
> http://stackoverflow.com/questions/27095320/common-lisp-how-to-get-in-package-to-work-from-within-emacs-slime
>
> When I rewrite the above to
>
> (eval-when (:compile-toplevel :load-toplevel :execute)
>   (asdf:load-ssytem '#:foo))
> (in-package #'foo)
>
> It loads the package, but can't change the current REPL package
> to it, SLIME continues to say CL-USER.
>
> I also realize that slime may be LOADing the file, which preserves the
> current package. Since I get a => <PACKAGE "FOO"> in my *slime-events*
> buffer I think that may be also happening.
>
> Is there any way to change the current REPL package by using any SLIME
> evaluation methods that involve evaluating a region? Or must I either manually
> type (in-package :foo) in the REPL or use the ,in-package SLIME command helper.
>
> I'm just about to write some elisp to take the region, find the slime repl
> buffer, manually append the region into the REPL buffer, and enter a return to
> execute it! There must be a better way!
>
> Thank you!
>
> -pete
>



-- 
With best regards, Stas.



More information about the slime-devel mailing list