[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Some comments on SRFI-13

This page is part of the web mail archives of SRFI 13 from before July 7th, 2015. The new archives for SRFI 13 contain all messages, not just those from before July 7th, 2015.



Hi.

First of all, thanks for this SRFI!
Some comments:

1. string-take and string-take-right:
   As the terms "prefix" and "suffix" are used in other function names,
   why not call these string-prefix and string-suffix ?

2. string-drop and string-drop-right might be too much as they
   can be replaced by a simple call to string-take and string-take-right,
   resp.

3. string-delete, string-skip, and string-skip-right (A)
   might be superfluous. They can be replaced by calls to
   string-filter, string-index, and string-index-right (B),
   resp.
   One argument for dropping them is that even a SRFI in Scheme should
   be "lean".
   Let's take 'do' as an example:
   'do' uses an exit condition and there is no similar construct with
   a running condition (like PASCAL-while).
   The functions in (A) and (B) differ only in the kind of condition.
   So, dropping (A) would make programs more understandable. (You don't
   have to ponder which kind of condition is provided.)

4. string-prefix-count etc.
   A name like string-common-prefix-length would be more predictable
   since "-length" is used in similar contexts in this SRFI.

5. reverse-string-concatanate and reverse-string-concatenate/shared:
   The second optional argument is not in parallel to string-concatenate.
   It seems to be too specific although I know that there are some contexts
   where this argument would be handy.

6. join-strings:
   Looking at the name "string-concatenate", I would expect "string-join"
   for this function.

7. additional functions:

   string-common-prefix s1 s2 -> string
   the longest common prefix of strings s1 and s2
   (Similar: string-common-suffix, string-common-prefix-ci, and
   string-common-suffix-ci)

   Substitution functions, something like:
   "substitute in string s1, range start to end by string s2."

8. character sets: Maybe there should be a discussion of the problem of
   character sets and character (and string) comparisons (and changing case).
   (ASCII, ISO 8859-1, ISO 8859-n, Unicode, etc.)

Ciao
Sven

------------------------------------------------------------------------------
Sven Hartrumpf            e-mail: Sven.Hartrumpf@xxxxxxxxxxxxxxxx
Computer Science VII (AI)
University of Hagen
58084 Hagen - Germany     http://pi7.fernuni-hagen.de/hartrumpf