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 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 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