Search code examples
lispcommon-lispgnu-common-lisp

Common Lisp: getting an error using readtable-case


When I enter this at the REPL prompt:

(setf (readtable-case *readtable*) :invert)

I get this error message:

Error in SETF [or a callee]: Cannot expand the SETF form (READTABLE-CASE
                                                          *READTABLE*).

Why do I get this error?


Solution

  • (format nil "~A ~A" (lisp-implementation-type) (lisp-implementation-version)) says "Kyoto Common Lisp GCL 2.6.2". The result of (eq 'readtable-case 'cl:readtable-case) is T. What does this all mean please?

    The second expression means you're using the correct symbol. The first indicates which Lisp implementation you're using: That should be GNU Common Lisp 2.6.2

    After some search I found this message on the gcl-devel list saying ...

    The problem appears to be this line:

    (setf (readtable-case *readtable*) readcase)
    

    in randomly-check-readability. I'd recommend this as the next ansi issue to resolve, since it's blocking the tests.

    ... with a subject line "ansi-tests in 2.7.0". The message is from 2004.

    Bottom line: I guess you need a more recent or even* a different Lisp implementation.

    (* as mentioned by Rainer Joswig the issue also affects the current 2.6.12 release)


    I guess all major Lisp implementations support this. CLISP 2.49 does, SBCL and CCL probably do, as far as I know ECL does also.