nstring-upcase nstring-downcase nstring-capitalize
(nstring-upcase string &key start end) -- (nstring-downcase string &key start end) -- (nstring-capitalize string &key start end)
The destructive spellings of string-upcase, string-downcase and string-capitalize: the folded characters are written back into the argument, and the string is returned. The fold is the non-destructive sibling's, so the returned value is the same on every backend.
The write is real for any string the running program allocated -- what make-string and (make-array n :element-type 'character) build, and equally a copy-seq/subseq slice or a concatenate 'string / string-upcase-family / format nil / with-output-to-string / read-line result: the very same object comes back, and a caller holding its own reference sees the change.
For a string literal -- and, on the compiled backends, for the few remaining producers whose results are still immutable values there (princ-to-string, for example) -- the fold lands on a rebuilt string rather than a write, which is the deviation every indexed write ((setf (aref s i) c), replace, fill) has for those strings. Portable code uses the returned value, which is correct on all four backends whatever the argument was:
:start / :end bound the part that is folded, exactly as for the non-destructive siblings: the characters outside it are kept, a nil :end means the end of the string, and a bad bound (a nil :start included) is the sibling's type-error.
Each is a first-class function value, so #'nstring-upcase can be passed to funcall, mapcar or intern.
Backend support
All four backends -- one definition in rontolisp source, spliced into the program when it is referenced.