The output of the following program solving the Towers of Hanoi problem in Common Lisp directs the output of the "format" statement to the "*inferior-lisp*" buffer instead of to the "*slime-repl clisp-2.37*" buffer on Windows XP Professional, Service Pack 3:
(defun hanoi (n) (hanoi-helper n 'A 'B 'C))
(defun hanoi-helper (n source dest using) (cond ((equalp n 1) (format t "Move disc from ~A to ~A.~%" source dest)) (t (progn (hanoi-helper (- n 1) source using dest) (hanoi-helper 1 source dest using) (hanoi-helper (- n 1) using dest source)))))
When "M-x slime-redirect-inferior-output RET" is invoked in Lispbox Emacs, the output is redirected correctly, but so is the rest of the output to the "*inferior-lisp*" buffer. This is not a clean solution.
Does anybody know how to get the above hanoi-helper procedure to direct the output of the "format" statement correctly to the REPL, instead of to the "*inferior-lisp*" buffer?
(This point is probably not relevant, but I have reconfigured Lispbox to call my .emacs file using my existing GNU Emacs 22.3.1 installation.)
-- Benjamin L. Russell
On Fri, 29 May 2009 15:06:30 +0900, Benjamin L. Russell DekuDekuplex@Yahoo.com wrote:
The output of the following program solving the Towers of Hanoi problem in Common Lisp directs the output of the "format" statement to the "*inferior-lisp*" buffer instead of to the "*slime-repl clisp-2.37*" buffer on Windows XP Professional, Service Pack 3:
(defun hanoi (n) (hanoi-helper n 'A 'B 'C))
(defun hanoi-helper (n source dest using) (cond ((equalp n 1) (format t "Move disc from ~A to ~A.~%" source dest)) (t (progn (hanoi-helper (- n 1) source using dest) (hanoi-helper 1 source dest using) (hanoi-helper (- n 1) using dest source)))))
When "M-x slime-redirect-inferior-output RET" is invoked in Lispbox Emacs, the output is redirected correctly, but so is the rest of the output to the "*inferior-lisp*" buffer. This is not a clean solution.
Does anybody know how to get the above hanoi-helper procedure to direct the output of the "format" statement correctly to the REPL, instead of to the "*inferior-lisp*" buffer?
(This point is probably not relevant, but I have reconfigured Lispbox to call my .emacs file using my existing GNU Emacs 22.3.1 installation.)
Actually, I just discovered that the "format" statement does work correctly if I use the default Lispbox setup, which ignores my .emacs file, but does not work if set it up to use my .emacs file.
Here is the relevant code for invoking SLIME with CLISP and Clojure:
;; Setup for Clojure (add-to-list 'load-path "C:/Program Files/Clojure Box/swank-clojure") (require 'swank-clojure-autoload) (swank-clojure-config (setq swank-clojure-jar-path "C:/Program Files/Clojure Box/clojure/clojure-1.0.0.jar") (setq swank-clojure-extra-classpaths (list "C:/Program Files/Clojure Box/clojure-contrib/classes/clojure/contrib")))
;; Setup for SLIME ; (setq inferior-lisp-program "sbcl") (setq inferior-lisp-program "C:/bin/clisp-2.45/full/lisp.exe -B C:/bin/clisp-2.45/full -M C:/bin/clisp-2.45/full/lispinit.mem -ansi -q") (add-to-list 'load-path "C:/bin/emacs/site-lisp/slime/") (require 'slime) (slime-setup '(slime-fancy slime-asdf slime-banner))
Any ideas on what could be wrong?
-- Benjain L. Russell
On Fri, 29 May 2009 16:39:43 +0900, Benjamin L. Russell DekuDekuplex@Yahoo.com wrote:
On Fri, 29 May 2009 15:06:30 +0900, Benjamin L. Russell DekuDekuplex@Yahoo.com wrote:
The output of the following program solving the Towers of Hanoi problem in Common Lisp directs the output of the "format" statement to the "*inferior-lisp*" buffer instead of to the "*slime-repl clisp-2.37*" buffer on Windows XP Professional, Service Pack 3:
(defun hanoi (n) (hanoi-helper n 'A 'B 'C))
(defun hanoi-helper (n source dest using) (cond ((equalp n 1) (format t "Move disc from ~A to ~A.~%" source dest)) (t (progn (hanoi-helper (- n 1) source using dest) (hanoi-helper 1 source dest using) (hanoi-helper (- n 1) using dest source)))))
When "M-x slime-redirect-inferior-output RET" is invoked in Lispbox Emacs, the output is redirected correctly, but so is the rest of the output to the "*inferior-lisp*" buffer. This is not a clean solution.
Does anybody know how to get the above hanoi-helper procedure to direct the output of the "format" statement correctly to the REPL, instead of to the "*inferior-lisp*" buffer?
(This point is probably not relevant, but I have reconfigured Lispbox to call my .emacs file using my existing GNU Emacs 22.3.1 installation.)
Actually, I just discovered that the "format" statement does work correctly if I use the default Lispbox setup, which ignores my .emacs file, but does not work if set it up to use my .emacs file.
Here is the relevant code for invoking SLIME with CLISP and Clojure:
;; Setup for Clojure (add-to-list 'load-path "C:/Program Files/Clojure Box/swank-clojure") (require 'swank-clojure-autoload) (swank-clojure-config (setq swank-clojure-jar-path "C:/Program Files/Clojure Box/clojure/clojure-1.0.0.jar") (setq swank-clojure-extra-classpaths (list "C:/Program Files/Clojure Box/clojure-contrib/classes/clojure/contrib")))
;; Setup for SLIME ; (setq inferior-lisp-program "sbcl") (setq inferior-lisp-program "C:/bin/clisp-2.45/full/lisp.exe -B C:/bin/clisp-2.45/full -M C:/bin/clisp-2.45/full/lispinit.mem -ansi -q") (add-to-list 'load-path "C:/bin/emacs/site-lisp/slime/") (require 'slime) (slime-setup '(slime-fancy slime-asdf slime-banner))
Any ideas on what could be wrong?
Another strange symptom is that Clojure Box, which uses the same .emacs file, directs the output of functions correctly to the SLIME REPL, but that Lispbox, when using the same .emacs file, does not. (In order to use my regular Emacs with CLISP 2.45, I need to comment out the Clojure-related section of my .emacs file; I'm planning to fix this bug later.)
Clojure Box uses the CVS version of SLIME, whereas Lispbox uses the (rather ancient) SLIME 2.0 and CLISP 2.37. However, when the same problem occurs when I configure my .emacs file to work with the CVS version of SLIME using CLISP 2.45.
(According to the blog entry "Installing CLISP, Emacs, and SLIME on Windows XP ? What’s In Peter’s Head" (see http://www.pchristensen.com/blog/articles/installing-clisp-emacs-and-slime-o...), under the heading "4. Setup SLIME," CLISP apparently broken compatibility with SLIME version 2.0 around CLISP version 2.44; _viz._:
CLISP changed recently (around version 2.44 - not sure exactly) and broke compatibility with the SLIME 2.0 release. This was fixed in development and the CVS snapshot works. If you try to use the 2.0 release, you’ll get an error that looks like this:
INTERN(”FRAME-UP-1″): #<PACKAGE SYSTEM> is locked
So use the CVS snapshot (which I linked to) and you should be fine.
)
Therefore, somehow the CVS version of SLIME works correctly with Clojure and my .emacs file, but not with CLISP 2.45 and my .emacs file. SLIME version 2.0 also does not works correctly with my .emacs file and CLISP 2.37, but it works correctly without my .emacs file.
Is there a way to get CLISP 2.45 to work correctly with SLIME and my .emacs file?
-- Benjamin L. Russell
On Fri, 29 May 2009 17:14:31 +0900, Benjamin L. Russell DekuDekuplex@Yahoo.com wrote:
[...]
Clojure Box uses the CVS version of SLIME, whereas Lispbox uses the (rather ancient) SLIME 2.0 and CLISP 2.37. However, when the same problem occurs when I configure my .emacs file to work with the CVS version of SLIME using CLISP 2.45.
Clarification and typo correction:
"Clojure Box uses the CVS version of SLIME dated March 11, 2009, at 22:18 and Clojure 1.0.0, whereas Lispbox uses the (rather ancient) SLIME 2.0 and CLISP 2.37. However, the same problem occurs when I configure my .emacs file to work with the CVS version of SLIME downloadable from http://common-lisp.net/project/slime/snapshots/slime-current.tgz, using CLISP 2.45."
-- Benjamin L. Russell
On Fri, 29 May 2009 19:07:07 +0900, Benjamin L. Russell DekuDekuplex@Yahoo.com wrote:
On Fri, 29 May 2009 17:14:31 +0900, Benjamin L. Russell DekuDekuplex@Yahoo.com wrote:
[...]
Clojure Box uses the CVS version of SLIME, whereas Lispbox uses the (rather ancient) SLIME 2.0 and CLISP 2.37. However, when the same problem occurs when I configure my .emacs file to work with the CVS version of SLIME using CLISP 2.45.
Clarification and typo correction:
"Clojure Box uses the CVS version of SLIME dated March 11, 2009, at 22:18 and Clojure 1.0.0, whereas Lispbox uses the (rather ancient) SLIME 2.0 and CLISP 2.37. However, the same problem occurs when I configure my .emacs file to work with the CVS version of SLIME downloadable from http://common-lisp.net/project/slime/snapshots/slime-current.tgz, using CLISP 2.45."
On Mon, 01 Jun 2009 17:07:54 +0900, Benjamin L. Russell DekuDekuplex@Yahoo.com wrote:
On Mon, 01 Jun 2009 16:52:29 +0900, Benjamin L. Russell DekuDekuplex@Yahoo.com wrote:
[...]
Actually, whether you have this problem probably depends on your setup; I only have it with my regular GNU Emacs (which reads in my .emacs file) when calling "M-x slime RET", but not when using the default Lispbox (which ignores that file). Here's the relevant section from my .emacs file:
;; Setup for SLIME (setq inferior-lisp-program "C:/bin/clisp-2.45/full/lisp.exe -B C:/bin/clisp-2.45/full -M C:/bin/clisp-2.45/full/lispinit.mem -ansi -q") (add-to-list 'load-path "C:/bin/emacs/site-lisp/slime/") (require 'slime) (slime-setup '(slime-fancy slime-asdf slime-banner))
I finally discovered a patch, posted by Samium Gromoff in the thread "PATCH Output redirection in the SIMPLE SERVE EVENTS case." (see http://article.gmane.org/gmane.lisp.slime.devel/8513), documenting this bug and patching it.
However, it introduced a new bug: This time, the banner does not appear, and I get the following lines in my REPL at startup, instead:
CL-USER> ;; Loading file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-asdf.fas ... ;; Loaded file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-asdf.fas ;; Loading file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-package-fu.fas ... ;; Loaded file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-package-fu.fas ;; Loading file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-fuzzy.fas ... ;; Loading file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-c-p-c.fas ... ;; Loaded file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-c-p-c.fas ;; Loaded file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-fuzzy.fas ;; Loading file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-fancy-inspector.fas ... ;; Loaded file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-fancy-inspector.fas ;; Loading file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-arglists.fas ... ;; Loaded file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-arglists.fas ;; Loading file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-presentations.fas ... ;; Loaded file C:\home.slime\fasl\2009-05-19\clisp-2.45-win32-pc386\contrib\swank-presentations.fas CL-USER> CL-USER>
Anybody know how to patch this patch? Apparently, this patch does not seem to have been applied in the CVS version of swank.lisp downloadable from http://common-lisp.net/project/slime/snapshots/slime-current.tgz.
-- Benjamin L. Russell