Why do you need to change the current directory from SLIME? I assume that this is not because you want to visit the source Lisp file from the system you are currently writing, but because you want to write code that reads or writes to a file containing data.
If so, it is probably best to try local-projects in Quicklisp . Together with quickproject it makes it easy to create systems that you can load using (ql:quickload 'my-system) or even (require 'my-system) .
If you need to refer to the data file located relative to the root of the my-system (just using the name from the last paragraph to bring the examples in line), you can use asdf:system-relative-pathname . For example, (asdf:system-relative-pathname 'my-system "files/data.txt") .
Of course, deployment is a completely different business. My solution is to see how the executable executable was launched to determine if the code is being deployed or is under development. If under development, I use asdf:system-relative-pathname . If it is deployed, I determine the path to the files based on the path of the executable file (my build script "copies these files next to the executable files when creating the project).
Since I started using this approach, my need for cd -ing in SBCL dropped to zero. cd around was not difficult, but it was nice to have fewer things to worry about.
Miron brezuleanu
source share