Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tokenize-symbol-thoroughly is incorrect under *print-case*=:invert #766

Open
kchanqvq opened this issue May 4, 2023 · 0 comments
Open

Comments

@kchanqvq
Copy link

kchanqvq commented May 4, 2023

> (swank::tokenize-symbol-thoroughly "cl-user:Test")
"tEST"
"CL-USER"
nil

This is incorrect, symbol-name of cl-user:Test is Test. *print-case*=:invert only invert the case if all characters are upper or lower case.

I'm looking at a way to fix tokenize-symbol-thoroughly. We can add the above test, or I wonder can we reuse the Lisp reader/printer and do something like

(defun convert-case (string)
  "Convert external representation of STRING into internal representation
for `package-name's and `symbol-name's."
  (let ((*print-case* :upcase))
    (format nil "~a" (make-symbol string))))
(defun unconvert-case (string)
  (let ((*print-case* :downcase))
    (format nil "~a" (make-symbol string))))

Maybe we can even replace the current logic that handles escape character and delegate to the Lisp reader/printer. Is this a good idea?

kchanqvq added a commit to kchanqvq/slime that referenced this issue May 4, 2023
kchanqvq added a commit to kchanqvq/slime that referenced this issue May 4, 2023
kchanqvq added a commit to kchanqvq/slime that referenced this issue May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant