chickadee » srfi-130 » string-concatenate-reverse

string-concatenate-reverseprocedure

With no optional arguments, this function is equivalent to

(string-concatenate (reverse string-list))

If the optional argument final-string is specified, it is consed onto the beginning of string-list before performing the list-reverse and string-concatenate operations.

If the optional argument end is given, only the characters up to but not including end in final-string are added to the result, thus producing

(string-concatenate
  (reverse (cons (substring final-string
                            (string-cursor-start final-string)
                            end)
                 string-list)))

E.g.

(string-concatenate-reverse '(" must be" "Hello, I") " going.XXXX" 7)
  => "Hello, I must be going."

This procedure is useful in the construction of procedures that accumulate character data into lists of string buffers, and wish to convert the accumulated data into a single string when done.