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

Re: Titlecase

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



John.Cowan wrote:
> I think this SRFI should have char-titlecase and string-titlecase
> functions.  The former maps a lowercase or uppercase character into
> its titlecase equivalent, and leaves all other characters alone.
> The latter titlecases its first character and lowercases all the rest;
> it's trivial to define string-titlecase given char-titlecase, but it's
> IMHO worth having for symmetry.

String-titlecase is part of SRFI 13, although with different semantics
from what you describe.  For example:

(string-titlecase "--capitalize tHIS sentence.") =>
  "--Capitalize This Sentence."

string-titlecase  s [start end] -> string
string-titlecase! s [start end] -> unspecified

"For every character c in the selected range of s, if c is preceded by a
cased character, it is downcased; otherwise it is titlecased."

David