[slime-devel] Autodoc-arglist display (extract-cursor-marker), Lispworks.

This doesn't work in Lispworks. It boils down to Lispworks signaling an error when you try to loop over something that is not a list. In this case a symbol, i.e.: (loop for (car . cdr) on form ...) when form is a symbol will simply loop over no items in SBCL, CLISP, etc, but will signal an error in Lispworks. I'm not sure which implementation is correct, but I think Lispworks' behaviour is slightly less surprising. I've attached a (hopefully correct) patch. It doesn't seem to break SBCL or CLISP, but I haven't tested with any other implementations. -- Johannes Grødem

Johannes Grødem <johs@netfonds.no> writes:
This doesn't work in Lispworks. It boils down to Lispworks signaling an error when you try to loop over something that is not a list. In this case a symbol, i.e.:
(loop for (car . cdr) on form ...) when form is a symbol will simply loop over no items in SBCL, CLISP, etc, but will signal an error in Lispworks.
I'm not sure which implementation is correct, but I think Lispworks' behaviour is slightly less surprising.
I've attached a (hopefully correct) patch. It doesn't seem to break SBCL or CLISP, but I haven't tested with any other implementations.
What was the form that caused autodoc to result in such an error? -T. PS. In order to test autodoc, you can do M-x slime-run-one-test RET autodoc.1 RET

* Tobias C. Rittweiler:
(loop for (car . cdr) on form ...) when form is a symbol will simply loop over no items in SBCL, CLISP, etc, but will signal an error in Lispworks. [...] What was the form that caused autodoc to result in such an error?
Here's a trace of autodoc when I type "(car" in the REPL. 0 SWANK:AUTODOC > ...
SWANK::RAW-FORM : ("car" SWANK::%CURSOR-MARKER%) SWANK::PRINT-RIGHT-MARGIN : 108 SWANK::PRINT-LINES : NIL 0 SWANK:AUTODOC < ...
PS. In order to test autodoc, you can do M-x slime-run-one-test RET autodoc.1 RET
Ok, thanks. There are some errors for Lispworks, but they seem to be unrelated. -- Johannes Grødem Failed on 4 (0 expected) of 19 tests. * autodoc.1 ** input: ((swank::emacs-connected*HERE* (emacs-connected)) OK: At the top level (no debugging or pending RPCs) OK: Autodoc in `(swank::emacs-connected' (at 24) is as expected: expected: ["(emacs-connected)"] actual: ["(emacs-connected)"] OK: Autodoc in `(swank::emacs-connected)' (at 24) is as expected: expected: ["(emacs-connected)"] actual: ["(emacs-connected)"] ** input: ((swank::emacs-connected *HERE* (emacs-connected)) OK: At the top level (no debugging or pending RPCs) OK: Autodoc in `(swank::emacs-connected ' (at 25) is as expected: expected: ["(emacs-connected)"] actual: ["(emacs-connected)"] OK: Autodoc in `(swank::emacs-connected )' (at 25) is as expected: expected: ["(emacs-connected)"] actual: ["(emacs-connected)"] ** input: ((swank::create-socket*HERE* (create-socket host port)) OK: At the top level (no debugging or pending RPCs) OK: Autodoc in `(swank::create-socket' (at 22) is as expected: expected: ["(create-socket host port)"] actual: ["(create-socket host port)"] OK: Autodoc in `(swank::create-socket)' (at 22) is as expected: expected: ["(create-socket host port)"] actual: ["(create-socket host port)"] ** input: ((swank::create-socket *HERE* (create-socket ===> host <=== port)) OK: At the top level (no debugging or pending RPCs) OK: Autodoc in `(swank::create-socket ' (at 23) is as expected: expected: ["(create-socket ===> host <=== port)"] actual: ["(create-socket ===> host <=== port)"] OK: Autodoc in `(swank::create-socket )' (at 23) is as expected: expected: ["(create-socket ===> host <=== port)"] actual: ["(create-socket ===> host <=== port)"] ** input: ((swank::create-socket foo *HERE* (create-socket host ===> port <===)) OK: At the top level (no debugging or pending RPCs) OK: Autodoc in `(swank::create-socket foo ' (at 27) is as expected: expected: ["(create-socket host ===> port <===)"] actual: ["(create-socket host ===> port <===)"] OK: Autodoc in `(swank::create-socket foo )' (at 27) is as expected: expected: ["(create-socket host ===> port <===)"] actual: ["(create-socket host ===> port <===)"] ** input: ((swank::create-socket foo bar *HERE* (create-socket host port)) OK: At the top level (no debugging or pending RPCs) OK: Autodoc in `(swank::create-socket foo bar ' (at 31) is as expected: expected: ["(create-socket host port)"] actual: ["(create-socket host port)"] OK: Autodoc in `(swank::create-socket foo bar )' (at 31) is as expected: expected: ["(create-socket host port)"] actual: ["(create-socket host port)"] ** input: (#'(lambda () (swank::create-socket*HERE* (create-socket host port)) OK: At the top level (no debugging or pending RPCs) OK: Autodoc in `#'(lambda () (swank::create-socket' (at 35) is as expected: expected: ["(create-socket host port)"] actual: ["(create-socket host port)"] OK: Autodoc in `#'(lambda () (swank::create-socket)' (at 35) is as expected: expected: ["(create-socket host port)"] actual: ["(create-socket host port)"] ** input: (`(lambda () ,(swank::create-socket*HERE* (create-socket host port)) OK: At the top level (no debugging or pending RPCs) OK: Autodoc in ``(lambda () ,(swank::create-socket' (at 35) is as expected: expected: ["(create-socket host port)"] actual: ["(create-socket host port)"] OK: Autodoc in ``(lambda () ,(swank::create-socket)' (at 35) is as expected: expected: ["(create-socket host port)"] actual: ["(create-socket host port)"] ** input: ((remove-if #'(lambda () (swank::create-socket*HERE* (create-socket host port)) OK: At the top level (no debugging or pending RPCs) OK: Autodoc in `(remove-if #'(lambda () (swank::create-socket' (at 46) is as expected: expected: ["(create-socket host port)"] actual: ["(create-socket host port)"] OK: Autodoc in `(remove-if #'(lambda () (swank::create-socket)' (at 46) is as expected: expected: ["(create-socket host port)"] actual: ["(create-socket host port)"] ** input: (`(remove-if #'(lambda () ,@(swank::create-socket*HERE* (create-socket host port)) OK: At the top level (no debugging or pending RPCs) OK: Autodoc in ``(remove-if #'(lambda () ,@(swank::create-socket' (at 49) is as expected: expected: ["(create-socket host port)"] actual: ["(create-socket host port)"] OK: Autodoc in ``(remove-if #'(lambda () ,@(swank::create-socket)' (at 49) is as expected: expected: ["(create-socket host port)"] actual: ["(create-socket host port)"] ** input: ((swank::symbol-status foo *HERE* (symbol-status symbol &optional ===> (package (symbol-package symbol)) <===)) OK: At the top level (no debugging or pending RPCs) OK: Autodoc in `(swank::symbol-status foo ' (at 27) is as expected: expected: ["(symbol-status symbol &optional ===> (package (symbol-package symbol)) <===)"] actual: ["(symbol-status symbol &optional ===> (package (symbol-package symbol)) <===)"] OK: Autodoc in `(swank::symbol-status foo )' (at 27) is as expected: expected: ["(symbol-status symbol &optional ===> (package (symbol-package symbol)) <===)"] actual: ["(symbol-status symbol &optional ===> (package (symbol-package symbol)) <===)"] ** input: ((defmethod swank::arglist-dispatch (*HERE* (defmethod arglist-dispatch (===> operator <=== arguments) &body body)) OK: At the top level (no debugging or pending RPCs) OK: Autodoc in `(defmethod swank::arglist-dispatch (' (at 37) is as expected: expected: ["(defmethod arglist-dispatch (===> operator <=== arguments) &body body)"] actual: ["(defmethod arglist-dispatch (===> operator <=== arguments) &body body)"] OK: Autodoc in `(defmethod swank::arglist-dispatch ()' (at 37) is as expected: expected: ["(defmethod arglist-dispatch (===> operator <=== arguments) &body body)"] actual: ["(defmethod arglist-dispatch (===> operator <=== arguments) &body body)"] ** input: ((apply 'swank::eval-for-emacs*HERE* (apply 'eval-for-emacs &optional form buffer-package id &rest args)) OK: At the top level (no debugging or pending RPCs) OK: Autodoc in `(apply 'swank::eval-for-emacs' (at 30) is as expected: expected: ["(apply 'eval-for-emacs &optional form buffer-package id &rest args)"] actual: ["(apply 'eval-for-emacs &optional form buffer-package id &rest args)"] OK: Autodoc in `(apply 'swank::eval-for-emacs)' (at 30) is as expected: expected: ["(apply 'eval-for-emacs &optional form buffer-package id &rest args)"] actual: ["(apply 'eval-for-emacs &optional form buffer-package id &rest args)"] ** input: ((apply #'swank::eval-for-emacs*HERE* (apply #'eval-for-emacs &optional form buffer-package id &rest args)) OK: At the top level (no debugging or pending RPCs) OK: Autodoc in `(apply #'swank::eval-for-emacs' (at 31) is as expected: expected: ["(apply #'eval-for-emacs &optional form buffer-package id &rest args)"] actual: ["(apply #'eval-for-emacs &optional form buffer-package id &rest args)"] OK: Autodoc in `(apply #'swank::eval-for-emacs)' (at 31) is as expected: expected: ["(apply #'eval-for-emacs &optional form buffer-package id &rest args)"] actual: ["(apply #'eval-for-emacs &optional form buffer-package id &rest args)"] ** input: ((apply 'swank::eval-for-emacs foo *HERE* (apply 'eval-for-emacs &optional form ===> buffer-package <=== id &rest args)) OK: At the top level (no debugging or pending RPCs) OK: Autodoc in `(apply 'swank::eval-for-emacs foo ' (at 35) is as expected: expected: ["(apply 'eval-for-emacs &optional form ===> buffer-package <=== id &rest args)"] actual: ["(apply 'eval-for-emacs &optional form ===> buffer-package <=== id &rest args)"] OK: Autodoc in `(apply 'swank::eval-for-emacs foo )' (at 35) is as expected: expected: ["(apply 'eval-for-emacs &optional form ===> buffer-package <=== id &rest args)"] actual: ["(apply 'eval-for-emacs &optional form ===> buffer-package <=== id &rest args)"] ** input: ((apply #'swank::eval-for-emacs foo *HERE* (apply #'eval-for-emacs &optional form ===> buffer-package <=== id &rest args)) OK: At the top level (no debugging or pending RPCs) OK: Autodoc in `(apply #'swank::eval-for-emacs foo ' (at 36) is as expected: expected: ["(apply #'eval-for-emacs &optional form ===> buffer-package <=== id &rest args)"] actual: ["(apply #'eval-for-emacs &optional form ===> buffer-package <=== id &rest args)"] OK: Autodoc in `(apply #'swank::eval-for-emacs foo )' (at 36) is as expected: expected: ["(apply #'eval-for-emacs &optional form ===> buffer-package <=== id &rest args)"] actual: ["(apply #'eval-for-emacs &optional form ===> buffer-package <=== id &rest args)"] ** input: ((swank::with-retry-restart (:msg *HERE* (with-retry-restart (&key ===> (msg "Retry.") <===) &body body)) OK: At the top level (no debugging or pending RPCs) FAILED: Autodoc in `(swank::with-retry-restart (:msg ' (at 34) is as expected: expected: ["(with-retry-restart (&key ===> (msg \"Retry.\") <===) &body body)"] actual: ["(with-retry-restart (&key ===> (msg |Retry.|) <===) &body body)"] FAILED: Autodoc in `(swank::with-retry-restart (:msg )' (at 34) is as expected: expected: ["(with-retry-restart (&key ===> (msg \"Retry.\") <===) &body body)"] actual: ["(with-retry-restart (&key ===> (msg |Retry.|) <===) &body body)"] ** input: ((swank::start-server "/tmp/foo" :coding-system *HERE* (start-server port-file &key (style swank:*communication-style*) (dont-close swank:*dont-close*) ===> (coding-system swank::*coding-system*) <===)) OK: At the top level (no debugging or pending RPCs) FAILED: Autodoc in `(swank::start-server "/tmp/foo" :coding-system ' (at 48) is as expected: expected: ["(start-server port-file &key (style swank:*communication-style*) (dont-close swank:*dont-close*) ===> (coding-system swank::*coding-system*) <===)"] actual: ["(start-server port-file &key (style swank:*communication-style*) (dont-close swank:*dont-close*) ===> (coding-system swank::*coding-system*) <===)"] FAILED: Autodoc in `(swank::start-server "/tmp/foo" :coding-system )' (at 48) is as expected: expected: ["(start-server port-file &key (style swank:*communication-style*) (dont-close swank:*dont-close*) ===> (coding-system swank::*coding-system*) <===)"] actual: ["(start-server port-file &key (style swank:*communication-style*) (dont-close swank:*dont-close*) ===> (coding-system swank::*coding-system*) <===)"] ** input: ((swank::with-struct *HERE*(foo. x y) *struct* body1) (with-struct (conc-name &rest names) obj &body body) t) OK: At the top level (no debugging or pending RPCs) OK: Autodoc in `(swank::with-struct (foo. x y) *struct* body1)' (at 21) is as expected: expected: ["(with-struct (conc-name &rest names) obj &body body)"] actual: ["(with-struct (conc-name &rest names) obj &body body)"]

Johannes Grødem <johs@netfonds.no> writes:
* Tobias C. Rittweiler:
(loop for (car . cdr) on form ...) when form is a symbol will simply loop over no items in SBCL, CLISP, etc, but will signal an error in Lispworks. [...] What was the form that caused autodoc to result in such an error?
Here's a trace of autodoc when I type "(car" in the REPL.
0 SWANK:AUTODOC > ...
SWANK::RAW-FORM : ("car" SWANK::%CURSOR-MARKER%) SWANK::PRINT-RIGHT-MARGIN : 108 SWANK::PRINT-LINES : NIL 0 SWANK:AUTODOC < ...
Thanks that should be fixed now.
PS. In order to test autodoc, you can do M-x slime-run-one-test RET autodoc.1 RET
Ok, thanks. There are some errors for Lispworks, but they seem to be unrelated.
* autodoc.1
...
** input: ((swank::with-retry-restart (:msg *HERE* (with-retry-restart (&key ===> (msg "Retry.") <===) &body body)) OK: At the top level (no debugging or pending RPCs) FAILED: Autodoc in `(swank::with-retry-restart (:msg ' (at 34) is as expected: expected: ["(with-retry-restart (&key ===> (msg \"Retry.\") <===) &body body)"] actual: ["(with-retry-restart (&key ===> (msg |Retry.|) <===) &body body)"] FAILED: Autodoc in `(swank::with-retry-restart (:msg )' (at 34) is as expected: expected: ["(with-retry-restart (&key ===> (msg \"Retry.\") <===) &body body)"] actual: ["(with-retry-restart (&key ===> (msg |Retry.|) <===) &body body)"]
Ok these fail because ARGLIST calls REPLACE-STRINGS-WITH-SYMBOLS in Lispworks swank-backend -- and that function turns the "Retry." initform into a symbol. That kind of hackery was needed because Lispworks used to return arglist-information in stringified CLHS-style EBNF syntax (iirc on, e.g. FLET) -- hopefully that was fixed in the new Lispworks6. Perhaps patches are available for Lispworks <6, too? Anyway, the way REPLACE-STRINGS-WITH-SYMBOLS operates seems rather kludgy. I'd prefer if we could get rid of it, install some check, and point people to hopefully available patches.
** input: ((swank::start-server "/tmp/foo" :coding-system *HERE* (start-server port-file &key (style swank:*communication-style*) (dont-close swank:*dont-close*) ===> (coding-system swank::*coding-system*) <===)) OK: At the top level (no debugging or pending RPCs) FAILED: Autodoc in `(swank::start-server "/tmp/foo" :coding-system ' (at 48) is as expected: expected: ["(start-server port-file &key (style swank:*communication-style*) (dont-close swank:*dont-close*) ===> (coding-system swank::*coding-system*) <===)"] actual: ["(start-server port-file &key (style swank:*communication-style*) (dont-close swank:*dont-close*) ===> (coding-system swank::*coding-system*) <===)"] FAILED: Autodoc in `(swank::start-server "/tmp/foo" :coding-system )' (at 48) is as expected: expected: ["(start-server port-file &key (style swank:*communication-style*) (dont-close swank:*dont-close*) ===> (coding-system swank::*coding-system*) <===)"] actual: ["(start-server port-file &key (style swank:*communication-style*) (dont-close swank:*dont-close*) ===> (coding-system swank::*coding-system*) <===)"]
Ok, here a newline was added. Did you set `slime-autodoc-use-multiline-p' to T? The test should probably bind that to NIL during the test. I'll do just that. -T.

* "Tobias C. Rittweiler" <87bph7i8va.fsf@freebits.de> : Wrote on Wed, 06 Jan 2010 15:52:09 +0100: | | Ok these fail because ARGLIST calls REPLACE-STRINGS-WITH-SYMBOLS in | Lispworks swank-backend -- and that function turns the "Retry." | initform into a symbol. I have been using LWL-5.1 Pers without REPLACE-STRINGS-WITH-SYMBOLS and have not encountered any problem that REPLACE-STRINGS-WITH-SYMBOLS solves. Is there a test case which fails if REPLACE-STRINGS-WITH-SYMBOLS is not used? -- Madhu

Madhu <enometh@meer.net> writes:
* "Tobias C. Rittweiler" <87bph7i8va.fsf@freebits.de> : Wrote on Wed, 06 Jan 2010 15:52:09 +0100:
| | Ok these fail because ARGLIST calls REPLACE-STRINGS-WITH-SYMBOLS in | Lispworks swank-backend -- and that function turns the "Retry." | initform into a symbol.
I have been using LWL-5.1 Pers without REPLACE-STRINGS-WITH-SYMBOLS and have not encountered any problem that REPLACE-STRINGS-WITH-SYMBOLS solves.
Is there a test case which fails if REPLACE-STRINGS-WITH-SYMBOLS is not used?
flet -- With Best Regards, Stas.
participants (4)
-
Johannes Grødem
-
Madhu
-
Stas Boukarev
-
Tobias C. Rittweiler