libera/#commonlisp - IRC Chatlog
Search
14:11:12
kevingal
When you recompile a function in Emacs with C-c C-c, how is it decided which package to bind the function in? SLIME/SBCL seems to know if there's an (in-package ...) earlier in the file and uses that package.
14:12:03
kevingal
I thought that maybe it would search back through the file for the previous (in-package ...).
14:15:44
beach
But it does not bind the function in a package. It just sets the *PACKAGE* variable so that READ can do the right thing.
14:21:25
edgar-rft
the current CL package is probably not detected by SLIME but by SWANK (the CL code in the slime directory) which highly likely just returns the value of the CL: *PACKAGE* variable
14:22:15
beach
edgar-rft: But it doesn't use the current package. It uses the package indicated by the IN-PACKAGE form in the file.
14:29:51
_death
what's interesting is that the heuristic includes a forwards search as well.. so evaluating the defun form in "(defun foo () 42) (in-package :bar)" would happen in bar
14:51:58
kevingal
Found the answer: https://github.com/slime/slime/blob/e193bc5f3431a2f71f1d7a0e3f28e6dc4dd5de2d/slime.el#L1986-L1992
14:52:43
kevingal
"The current package is defined as the buffer-local value of `slime-buffer-package' if set, and otherwise the package named by the nearest IN-PACKAGE as found by text search (cl-first backwards, then forwards)."
18:06:16
jcowan
I find it irritating that there is no way to load a file and wind up in a different package (that I know of). For example, currently if you want to be dropped into an ISLisp REPL you need to both load islisp.lisp and do an (in-package :islisp).
18:09:43
pjb
jcowan: https://gitlab.com/com-informatimago/com-informatimago/-/blob/master/common-lisp/cesarum/utility.lisp#L344
18:11:49
jcowan
Although you still end up having to enter two forms, one to load utility.lisp and the one above.
18:13:20
pjb
jcowan: perhaps you'll prefer this: https://termbin.com/njcn and write just: (include-file "foo.lisp")
18:15:53
pjb
jcowan: you can also define your own REPL in the file, and run it, so that LOAD never returns.
18:17:01
pjb
jcowan: eg. add this at the end of your file: (let ((*package* (or (find-package "SOME-NEW-PACKAGE") (error "package not found")))) (loop (mapcar (function print) (multiple-value-list (eval (progn (princ "> ") (finish-output) (read)))))))
18:19:26
edwlan[m]
The goal was to be able to send a web socket event to the browser that would update a page containing docstrings for the current package
18:21:40
pjb
jcowan: you can use com.informatimago.common-lisp.interactive.interactive:repl instead.
19:23:43
mooseball
i'm trying to install mcclim, and cl-unicode fails to install, saying 'no symbol named "*STANDARD-OPTIMIZE-SETTINGS*" in "CL-PPCRE"'. anyone else seen this? i'm a newb.
19:27:15
Bike
mooseball: ppcre should have had that symbol for quite a while. what's (ql:where-is-system :cl-ppcre)?
19:29:00
mooseball
ah, that dep was loaded when i had the errors, but maybe i've tricked ql with an old version
19:32:19
mooseball
i moved version 1.2.3 out of the path, but where-is-system still thinks it is there. can i refresh my system list or force install?
19:34:22
Bike
where did you even find a fifteen year old version... well whatever. that depends on why asdf thinks it's there. was it in quicklisp local projects or something?
19:37:18
Bike
well, once you've deleted the directory, maybe just restart your lisp and see if asdf finds something more reasonable this time around
19:39:11
mooseball
it works... thx again B. also i'm surprised there isn't a refresh path like option. but anyway, rolling now.
23:32:57
whereiseveryone
For anyone interested this Sunday, Demo: Live Loading Common Lisp Systems with Guix https://mail.gnu.org/archive/html/guix-devel/2023-03/msg00363.html