dexador icon indicating copy to clipboard operation
dexador copied to clipboard

errors when *print-case* is :downcase

Open bo-tato opened this issue 1 year ago • 2 comments

I didn't like lisp shouting at me all the time so I set in my .sbclrc (setf *print-case* :downcase). This causes a problem with dexador when it does: (intern (format nil "~A-~A" :http-request name)) in src/error.lisp, then I can handle the condition with dexador.error::|http-request-not-found| but not with dex:http-request-not-found. I think I read in common lisp recipes and otherwhere that the user should be able to configure print-case, so maybe dexador shouldn't depend on this being the default and upcase the string from format before interning? I'm also pretty new at lisp though, if users aren't supposed to change print-case like I did then let me know and we just close issue.

bo-tato avatar Oct 10 '23 06:10 bo-tato

Wrapping call to format into with-standard-io-syntax should fix the issue. Additionally, there is an utility in alexandria (which already is a dependency) that does exactly that - format-symbol, which would be used here like this:

;; destination T means that the symbol is interned in the current package
(format-symbol t "~A-~A" :http-request name)

Gleefre avatar Jan 25 '24 15:01 Gleefre

since alexandria is already a dependency I made a PR using format-symbol https://github.com/fukamachi/dexador/pull/165

bo-tato avatar Jan 29 '24 00:01 bo-tato