[slime-devel] "Unbalanced parentheses"

Edi Weitz edi at agharta.de
Sun Sep 4 23:34:07 UTC 2005


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.



More information about the slime-devel mailing list