joaotavora / sly

Sylvester the Cat's Common Lisp IDE
1.23k stars 139 forks source link

Use WITH-STANDARD-IO-SYNTAX for reading literals #564

Closed lukego closed 1 year ago

lukego commented 1 year ago

Add robustness to symbol lookups of the form:

(read-from-string "a-package::a-symbol")

by giving them stable reader settings:

(with-standard-io-syntax ...)

so that they work the same independent of the reader settings in the image.

(I noticed that SLY compile commands stopped working when I was using named-readtables and :PRESERVE case. SLYNK would start looking for symbols with lowercase symbol-names.)

joaotavora commented 1 year ago

This looks good, but wouldn't it be even better if we had some kind of stable-read-from-string in :slynk-backend package that abstracted away this detail?

lukego commented 1 year ago

Yet another alternative would be to call FIND-SYMBOL which does the job more directly. I did it that way at first but switched because the diff was harder to read/check and I didn't have access to all platforms to test.

joaotavora commented 1 year ago

Yet another alternative would be to call FIND-SYMBOL which does the job more directly. I did it that way at first but switched because the diff was harder to read/check and I didn't have access to all platforms to test.

Yes, and FIND-SYMBOL, like intern, doesn't seem to be read-table sensitive. But as I remember it, it's also not quite as practical (can't remember why). Anyway, I added another commit to this PR that simplifies this for anyone wanting to come along and do the right thing in slynk-backend.lisp. Can you test it?