- String Tools -

Hi All,

I have put together a new string library.

Comments are welcome.

2 Likes

Things you may consider:

  • You may explicitly state that ASCII is 7 bit code point one, not extended ASCII. Perhaps in Scheme land ASCII predominantly means 7 bit one.
  • string-{plural,singular}ize - these are not general string functions. They are at least partially language aware and may be in a different package. Since you only cover s plurals this clearly leaves woman->women outside. But you can give an example whether it covers wife->wives.
  • The -left/right suffixes strongly indicate left to right writing systems. -start/end are more neutral
  • You mention SRFI-13 but if I am reading https://srfi.schemers.org/srfi-13/srfi-13.html#NamingConventions correctly:
    string-trim-left should be just string-trim

All these can be called nits.

Kind regards:
al_shopov

На нд, 22.02.2026 г. в 18:50 Jens Axel Søgaard <notifications@racket.discoursemail.com> написа:

1 Like

Hi Al,

Thanks for the feedback!

  • You may explicitly state that ASCII is 7 bit code point one, not extended ASCII. Perhaps in Scheme land ASCII predominantly means 7 bit one.

I looked it up. As I understand it "ASCII" is used for 7 bit and "extended ASCII" is used for 8 bit.

  • string-{plural,singular}ize - these are not general string functions. They are at least partially language aware and may be in a different package. Since you only cover s plurals this clearly leaves woman->women outside. But you can give an example whether it covers wife->wives.

These are indeed simplistic and restricted to English.
Are they too simple to be useful?

  • The -left/right suffixes strongly indicate left to right writing systems. -start/end are more neutral

Here I am attempting to use what's known from racket/string and srfi 13 which both use left/right.

I am following the lead of racket/string here. It has a string-trim (so I can't use the same name) that defaults to trimming from both sides. The keywords for one side trimming is #:left and #:right. So the three names I choose are: string-trim-both, string-trim-left and string-trim-right.

So what do people think, should I remove string-{plural,singular}ize ?