joaotavora / snooze

Common Lisp RESTful web development
207 stars 22 forks source link

Respect parameter case by default (i.e. make default reader respect `readtable-case` of the readtable) #25

Open joaotavora opened 4 years ago

joaotavora commented 4 years ago

This is a bug:

CL-USER> (let ((*readtable* (copy-readtable)))
           (setf (readtable-case *readtable*) :invert)
           (mapcar #'read-from-string '("foo" "Foo" "FOO")))
(FOO |Foo| |foo|)
CL-USER> (let ((*readtable* (copy-readtable)))
           (setf (readtable-case *readtable*) :invert)
           (mapcar #'snooze-safe-simple-read::safe-simple-read-from-string
                   '("foo" "Foo" "FOO")))
(FOO FOO FOO)
CL-USER> 

The way to fix this is probably to rewrite snooze-safe-simple-read to take advantage of the normal readtable turning off most of the character functions and preventing interning. This should also simplify a lot of the code.