CMUCL "CVS 19b 19b-release-20050628-3 + minimal debian patches (19B)" from Debian testing SLIME from CVS today GNU Emacs 21.4.1 from Debian testing
When loading a larger system I'm currently working on I always get "Unbalanced parentheses" errors. This is most likely due to this message that I see when doing the same on the console:
; In: LAMBDA (#:G2286 #:G2287 #:G2288)
; (LET (#) ; (DECLARE #) ; (LET # ; #)) ; Note: Deleting unreachable code. ; ; (FUNCALL (THE FUNCTION #'#) ; (PCL::FAST-METHOD-CALL-PV-CELL PCL::.CALL.) ; (PCL::FAST-METHOD-CALL-NEXT-METHOD-CALL PCL::.CALL.) ; PCL::.ARG0.) ; Note: Deleting unreachable code. ;
Nice message, but I don't know where it comes from, i.e. which part of my code it refers to. SLIME isn't very helpful either in this case because, as I said, I get Emacs errors, probably because Emacs sexp parsing fails here. Any idea for a workaround?
FWIW, the *SLIME Source Form* buffer looks like this:
; (LET (#) ; (DECLARE #) ; (LET # ; #))
And the last form in *slime-events* looks like this:
(:return (:ok ((:message "Deleting unreachable code." :severity :note :location (:location (:source-form "; (LET (#)\n; (DECLARE #)\n; (LET #\n; #))\n") (:position 1) nil) :references nil :short-message "Deleting unreachable code.") (:message "Deleting unreachable code." :severity :note :location (:location (:source-form "; (FUNCALL (THE FUNCTION #'#)\n; (PCL::FAST-METHOD-CALL-PV-CELL PCL::.CALL.)\n; (PCL::FAST-METHOD-CALL-NEXT-METHOD-CALL PCL::.CALL.)\n; PCL::.ARG0.)\n") (:position 1) nil) :references nil :short-message "Deleting unreachable code."))) 4)
And finally this is the Emacs backtrace:
Debugger entered--Lisp error: (scan-error "Unbalanced parentheses" 5 57) scan-sexps(2 1) forward-sexp(1) (or (forward-sexp 1) (point)) (progn (goto-char (1+ start)) (or (forward-sexp 1) (point))) (values (1+ start) (progn (goto-char ...) (or ... ...))) (if (slime-same-line-p start (point)) (values start (point)) (values (1+ start) (progn ... ...))) (let ((start ...)) (ignore-errors (slime-forward-sexp)) (if (slime-same-line-p start ...) (values start ...) (values ... ...))) slime-choose-overlay-for-sexp((:location (:source-form "; (LET (#)\n; (DECLARE #)\n; (LET #\n; #))\n") (:position 1) nil)) (if (eq (slime-note.severity note) :read-error) (values pos (1+ pos)) (slime-choose-overlay-for-sexp location)) (let* ((--rest--24678 rand-24676) (pos ...) (alignp ...)) (if --rest--24678 (signal ... ...)) (if (eq ... :read-error) (values pos ...) (slime-choose-overlay-for-sexp location))) (progn (let* (... ... ...) (if --rest--24678 ...) (if ... ... ...))) (destructuring-bind (pos &optional alignp) rand-24676 (if (eq ... :read-error) (values pos ...) (slime-choose-overlay-for-sexp location))) (cond ((eql op-24675 ...) (destructuring-bind ... rand-24676 ...)) (t (slime-choose-overlay-for-sexp location))) (case op-24675 (:position (destructuring-bind ... rand-24676 ...)) (t (slime-choose-overlay-for-sexp location))) (let* ((tmp-24677 pos) (op-24675 ...) (rand-24676 ...)) (case op-24675 (:position ...) (t ...))) (destructure-case pos ((:position pos &optional alignp) (if ... ... ...)) (t (slime-choose-overlay-for-sexp location))) (let* ((--rest--24674 rand-24672) (_file ...) (pos ...) (_hints ...)) (destructure-case pos (... ...) (t ...))) (progn (let* (... ... ... ...) (destructure-case pos ... ...))) (destructuring-bind (_file pos _hints) rand-24672 (destructure-case pos (... ...) (t ...))) (cond ((eql op-24671 ...) (destructuring-bind ... rand-24672)) ((eql op-24671 ...) (destructuring-bind ... rand-24672 ...)) (t (error "destructure-case failed: %S" tmp-24673))) (case op-24671 (:error (destructuring-bind ... rand-24672)) (:location (destructuring-bind ... rand-24672 ...)) (t (error "destructure-case failed: %S" tmp-24673))) (let* ((tmp-24673 location) (op-24671 ...) (rand-24672 ...)) (case op-24671 (:error ...) (:location ...) (t ...))) (destructure-case location ((:error msg)) ((:location _file pos _hints) (destructure-case pos ... ...))) (let ((location ...)) (destructure-case location (...) (... ...))) slime-choose-overlay-region((:message "Deleting unreachable code." :severity :note :location (:location (:source-form "; (LET (#)\n; (DECLARE #)\n; (LET #\n; #))\n") (:position 1) nil) :references nil :short-message "Deleting unreachable code.")) (let* ((G24670 ...) (start ...) (end ...)) (when start (goto-char start) (let ... ...))) (multiple-value-bind (start end) (slime-choose-overlay-region note) (when start (goto-char start) (let ... ...))) slime-overlay-note((:message "Deleting unreachable code." :severity :note :location (:location (:source-form "; (LET (#)\n; (DECLARE #)\n; (LET #\n; #))\n") (:position 1) nil) :references nil :short-message "Deleting unreachable code.")) mapc(slime-overlay-note ((:message "Deleting unreachable code." :severity :note :location (:location ... ... nil) :references nil :short-message "Deleting unreachable code.") (:message "Deleting unreachable code." :severity :note :location (:location ... ... nil) :references nil :short-message "Deleting unreachable code."))) (save-excursion (slime-remove-old-overlays) (mapc (function slime-overlay-note) (slime-merge-notes-for-display notes))) slime-highlight-notes(((:message "Deleting unreachable code." :severity :note :location (:location ... ... nil) :references nil :short-message "Deleting unreachable code.") (:message "Deleting unreachable code." :severity :note :location (:location ... ... nil) :references nil :short-message "Deleting unreachable code."))) (let* ((G24635 result) (result ...) (secs ...)) (slime-show-note-counts notes secs) (slime-highlight-notes notes)) (multiple-value-bind (result secs) result (slime-show-note-counts notes secs) (slime-highlight-notes notes)) (save-current-buffer (set-buffer buffer) (multiple-value-bind (result secs) result (slime-show-note-counts notes secs) (slime-highlight-notes notes))) (with-current-buffer buffer (multiple-value-bind (result secs) result (slime-show-note-counts notes secs) (slime-highlight-notes notes))) (let ((notes ...)) (with-current-buffer buffer (multiple-value-bind ... result ... ...)) (run-hook-with-args (quote slime-compilation-finished-hook) notes)) slime-compilation-finished(("NIL" "6.08") #<buffer *slime-repl cmucl*>) (lambda (G23990 result) (slime-compilation-finished result (symbol-value G23990)))(--buffer-- ("NIL" "6.08")) apply((lambda (G23990 result) (slime-compilation-finished result (symbol-value G23990))) --buffer-- ("NIL" "6.08")) (lambda (&rest --cl-rest--) (apply (quote ...) (quote --buffer--) --cl-rest--))(("NIL" "6.08")) funcall((lambda (&rest --cl-rest--) (apply (quote ...) (quote --buffer--) --cl-rest--)) ("NIL" "6.08")) (if (symbol-value G24002) (funcall (symbol-value G24002) result)) (let* ((--rest--24000 rand-23998) (result ...)) (if (symbol-value G24002) (funcall ... result))) (cond ((eql op-23997 ...) (let* ... ...)) ((eql op-23997 ...) (let* ... ... ...)) (t (error "destructure-case failed: %S" tmp-23999))) (let* ((tmp-23999 G23993) (op-23997 ...) (rand-23998 ...)) (cond (... ...) (... ...) (t ...))) (lambda (G24002 G23993) (let* (... ... ...) (cond ... ... ...)))(--cont-- (:ok ("NIL" "6.08"))) apply((lambda (G24002 G23993) (let* (... ... ...) (cond ... ... ...))) --cont-- (:ok ("NIL" "6.08"))) (lambda (&rest --cl-rest--) (apply (quote ...) (quote --cont--) --cl-rest--))((:ok ("NIL" "6.08"))) slime-dispatch-event((:return (:ok ("NIL" "6.08")) 3) #<process SLIME Lisp>) slime-process-available-input() slime-net-filter(#<process SLIME Lisp> "000021(:return (:ok ("NIL" "6.08")) 3)\n")
Thanks, Edi.
Edi Weitz edi@agharta.de writes:
When loading a larger system I'm currently working on I always get "Unbalanced parentheses" errors. This is most likely due to this
[...]
Nice message, but I don't know where it comes from, i.e. which part of my code it refers to. SLIME isn't very helpful either in this case
If you know at least the file name (e.g. by building the system from source outside of SLIME), you may try isolating the offending form by doing a binary search with compilation/evaluation.
Paolo
* Paolo Amoroso amoroso@mclink.it [2005-09-05T09:49+0200]:
Edi Weitz edi@agharta.de writes:
When loading a larger system I'm currently working on I always get "Unbalanced parentheses" errors. This is most likely due to this
[...]
Nice message, but I don't know where it comes from, i.e. which part of my code it refers to. SLIME isn't very helpful either in this case
If you know at least the file name (e.g. by building the system from source outside of SLIME), you may try isolating the offending form by doing a binary search with compilation/evaluation.
Are your sources containing #| ... |# comments, by chance? I think I've seen errors like this as well, and if I recall correctly I could make them go away by commenting the region with ;; instead.
Cheers, Michael
On Mon, 5 Sep 2005 10:30:06 +0200, Michael Weber michaelw+slime@foldr.org wrote:
Are your sources containing #| ... |# comments, by chance? I think I've seen errors like this as well, and if I recall correctly I could make them go away by commenting the region with ;; instead.
No, I don't use #| ... |# because I've seen Emacs choke on them several times already.
Edi Weitz writes:
On Mon, 5 Sep 2005 10:30:06 +0200, Michael Weber michaelw+slime@foldr.org wrote:
Are your sources containing #| ... |# comments, by chance? I think I've seen errors like this as well, and if I recall correctly I could make them go away by commenting the region with ;; instead.
No, I don't use #| ... |# because I've seen Emacs choke on them several times already.
It might help to use #|| ... ||# insteaad.
On Mon, 5 Sep 2005 15:59:02 +0200, Pascal Bourguignon pjb@informatimago.com wrote:
It might help to use #|| ... ||# insteaad.
Ah, OK, I'll try that. Thanks.
* Edi Weitz [2005-09-05 01:34+0200] writes:
Nice message, but I don't know where it comes from, i.e. which part of my code it refers to. SLIME isn't very helpful either in this case because, as I said, I get Emacs errors, probably because Emacs sexp parsing fails here. Any idea for a workaround?
I think it's fixed in CVS, but try to increase the values for *print-level* etc. so that the full form is printed.
My guess it that CMUCL generates the message while compiling/inlineing a method dispatch function at load time and that there is no useful/obvious "source location" for this kind of message anyway.
Helmut.
[Sorry for the delay. It took me a while to get back to this project.]
On Mon, 05 Sep 2005 16:02:37 +0200, Helmut Eller heller@common-lisp.net wrote:
I think it's fixed in CVS,
Yes, works without Emacs errors now. Thanks for the fix.
but try to increase the values for *print-level* etc. so that the full form is printed.
Will do.
Cheers, Edi.
On Mon, 05 Sep 2005 16:02:37 +0200, Helmut Eller heller@common-lisp.net wrote:
My guess it that CMUCL generates the message while compiling/inlineing a method dispatch function at load time and that there is no useful/obvious "source location" for this kind of message anyway.
FWIW, below is the note that caused the error in full length. Looks like something within CMUCL's PCL code.
; In: LAMBDA (#:G2505 #:G2506 #:G2507)
; (LET ((PCL::.LIST. #:G2507)) ; (DECLARE (IGNORABLE PCL::.LIST.)) ; (LET ((PCL::.CALL. (POP PCL::.LIST.))) ; (FUNCALL ; (THE FUNCTION ..)))) ; Note: Deleting unreachable code. ; ; (FUNCALL ; (THE FUNCTION #'(PCL:FAST-METHOD DATABASE-TYPE-LOAD-FOREIGN :AFTER (T))) ; (PCL::FAST-METHOD-CALL-PV-CELL PCL::.CALL.) ; (PCL::FAST-METHOD-CALL-NEXT-METHOD-CALL PCL::.CALL.) ; PCL::.ARG0.) ; Note: Deleting unreachable code.
Cheers, Edi.