Dear Slime Developers
I am using Slime with the following environment:
Slime 2010-03-01 (CVS head)
Emacs 22.3.1 (i386-apple-darwin9.8.0, Carbon Version 1.6.0)
Allegro CL Professional 8.2 (allegro-8.2a-ics-macosx-x86)
Mac OS X (10.6.2), MacBook
After upgrading Allegro to 8.2, slime-compile-file (also
slime-compile-and-load-file) gets errors like this:
------------------------------------------------------------
`(6 6)' is not of the expected type `NUMBER'
[Condition of type TYPE-ERROR]
------------------------------------------------------------
The backtrace of the error looks like:
------------------------------------------------------------
Backtrace:
0: (ERROR TYPE-ERROR :DATUM (6 6) :EXPECTED-TYPE NUMBER ...)
1: (SWANK-BACKEND::LOCATION-FOR-WARNING #<SIMPLE-WARNING @ #x20a331c2>)
Locals:
CONDITION = #<SIMPLE-WARNING @ #x20a331c2>
SWANK-BACKEND::POS = (6 6)
NIL = (:FILE "/Users/takuo/foo.lisp")
NIL = #<STANDARD-CLASS READER-ERROR>
SWANK-BACKEND::LOC = (#P"/Users/takuo/foo.lisp" 6 6)
SWANK-BACKEND::FILE = #P"/Users/takuo/foo.lisp"
2: (SWANK-BACKEND::HANDLE-COMPILER-WARNING #<SIMPLE-WARNING @ #x20a331c2>)
3: (SIGNAL #<SIMPLE-WARNING @ #x20a331c2>)
------------------------------------------------------------
The source of this error seems to be the change of the format of
condition location
(i.e., the value of the :loc property provided with the excl::plist
slot in a warning object).
For example, in the previous ACL (8.1), the value of :loc property
looks like this.
------------------------------------------------------------
CL-USER> (handler-case (compile-file "foo.lisp") (warning (w) (getf
(slot-value w 'excl::plist) :loc)))
(#P"foo.lisp" . 6)
------------------------------------------------------------
The car part of the value is the file name and the cdr is the warning
position in the file.
After upgrading to 8.2, the value of the above expression becomes
(#P"foo.lisp" 6 6).
I don't know about the difference among these two numbers.
Anyway, the function location-for-warning in swank-allegro.lisp assumes
that the cdr part of the value should be a number.
The (kludgey) patch I applied is the following.
I'm not sure this is really a solution to the problem.
------------------------------------------------------------
--- swank-allegro.lisp 2010-03-02 12:25:46.000000000 +0900
+++ swank-allegro.lisp.orig 2010-03-02 12:25:24.000000000 +0900
@@ -279,7 +279,7 @@
(destructuring-bind (file . pos) loc
(make-location
(list :file (namestring (truename file)))
- (list :position (1+ (if (listp pos) (car pos) pos))))))
+ (list :position (1+ pos)))))
(t
(make-error-location "No error location available.")))))
------------------------------------------------------------
Sorry, I didn't check any other platforms (Linux, Windows, etc.). I
only have a license for the OS X edition.
Cheers
Takuo Watanabe