When I do C-c C-k (SLIME compile/load file) the REPL stays at "CL-USER". Shouldn't it switch to "MORSE" because of the "(in-package :morse)" code line? I us GNU Emacs 24.3.1, SBCL 1.2.0 and SLIME 2014-04-27.
From: Frederik Cheeseman fc7alfa@evonet.be Date: Tue, 17 Jun 2014 07:54:20 +0000 (UTC)
When I do C-c C-k (SLIME compile/load file) the REPL stays at "CL-USER". Shouldn't it switch to "MORSE" because of the "(in-package :morse)" code line?
No (and this applies to CL in general, not just to SLIME). This is because, according to the spec, "load binds *readtable* and *package* to the values they held before loading the file." In effect:
(defun load (file &key ...) (let ((*package* *package*)) (in-load file ...)))
- n
Je Tue, 17 Jun 2014 07:54:20 +0000 (UTC) Frederik Cheeseman fc7alfa@evonet.be skribis:
When I do C-c C-k (SLIME compile/load file) the REPL stays at "CL-USER". Shouldn't it switch to "MORSE" because of the "(in-package :morse)" code line? I us GNU Emacs 24.3.1, SBCL 1.2.0 and SLIME 2014-04-27.
No, because the in-package call is only operational when compiling for the source file.