vindarel / cl-str

Modern, simple and consistent Common Lisp string manipulation library.
https://vindarel.github.io/cl-str/
MIT License
305 stars 37 forks source link

Fix: char-code for *whitespaces* characters #123

Open kilianmh opened 2 months ago

kilianmh commented 2 months ago

Use char-code for *whitespaces* characters. This should prevent future problems with some implementations that do not support specific characters in the reader.

This should work regardless of implementation. Tested on: sbcl, ccl, ecl, abcl, cmu, allegro.

From now on we should add characters only with char-code to avoid errors? @vindarel

vindarel commented 2 months ago

oooh this looks wise, but we are loosing a user-facing QoL.

We can easily see what's in the whitespaces variable:

str:*whitespaces*
(#\Backspace #\Tab #\Newline #\Newline #\Vt #\Page #\Return #\  #\Rubout
 #\Next-Line #\NO-BREAK_SPACE)

not so with charcodes.

I really like cl-str to be easily inspectable, clear, etc. Maybe there's a better way. Or we maintainers have to work harder and add some tests / a CI for the future.

kilianmh commented 2 months ago

not so with charcodes.

Is it? I get the same result with this PR when putting str:*whitespaces* in the repl.

Also there are comments after every character-code with the respective character.