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

Feat: keyword param char-bag for trim functions #86

Closed kilianmh closed 1 year ago

kilianmh commented 1 year ago

Is the parameter name char-bag appropriate? And do you like the documentation (same in docstring and readme)?

vindarel commented 1 year ago

Hi, I like the feature, that's a great addition.

Re naming: is "char-bag" a usual name for this? If it's used in other libraries of other languages, then why not re-use it. If not, let's find a shorter name? (no good idea… simply "chars" ? I'll welcome the opinion of native english speakers, if char-bag is the best self-explanatory, so be it)

I think the examples (in the readme and the docstrings, yeah it's the same, we need to copy-paste one time) could be more straightforward by using strange letters around a common word, like "(trim "xyfooxy" :char-bag "xy"), but that's a nitpick.

kilianmh commented 1 year ago

The change requested should be done.

I chose char-bag because

  1. in the CL function string-trim its character-bag
  2. in cl-str char is more used in parameters

chars is a straight forward short alternative. In the meantime the name char-set came to my mind. It's same length, however character set is commonly used compared to character bag.

vindarel commented 1 year ago

It's even char-bag for me:

(defun string-trim (char-bag string)
  (generic-string-trim char-bag string t t))

looks good then.

A bit busy, will double check tomorrow.

vindarel commented 1 year ago

Thanks!