0

In emacs lisp variables are not case sensitive, so if I define a variable x, I can access it using X, but I can modify the elisp behavior by (setq readtable-case :preserve), is there something similar for slime?

To check case sensitivity you can run 'abcd in the REPL and if you get ABCD the it's not case sensitive as by default it makes the symbols uppercase.

2
  • What do you mean by this: "In emacs lisp variables are not case sensitive"? Did you instead mean Common Lisp? Or did you instead mean case-insensitive? What do you mean by a variable being case-(in)sensitive? Do you mean that its name is? its value is (if a string)? Elisp has no readtable-case, so I thing you meant Common Lisp, not Emacs Lisp.
    – Drew
    Commented Feb 25, 2022 at 19:37
  • In emacs setting readtable-case made the symbols become case sensitive so I thought it was coming from elisp. It could be just related to function called on C-x X-e. Commented Feb 26, 2022 at 2:02

1 Answer 1

2

Common Lisps Reader converts all symbols to uppercase, when reading them. To use lowercase symbols in Common Lisp you have to escape them with | | or \.

So this is not an SLIME/SLY issue at all.

CL-USER> (defvar |x| 5)
|x|
CL-USER> |x|
5 (3 bits, #x5, #o5, #b101)
CL-USER> (defvar \x 5)
|x|
CL-USER> \x
5 (3 bits, #x5, #o5, #b101)
CL-USER> x
; Debugger entered on #<UNBOUND-VARIABLE X {10050E7643}>

See also this question: https://stackoverflow.com/questions/7375537/why-is-common-lisp-case-insensitive

1
  • This might work. Let me try it and see. I'd have to write something to rename all the variables to |var| manually, or do you know if there's some automated way for that? Commented Feb 26, 2022 at 2:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.