string-append(3scm)

πŸ“¦ version 0-unstable-2024-02, in nixpkgs unstable

✨ string-append(3scm) ✨

okay so bestie, you're reading the string-append page from the Scheme Programmer's Manual β€” yes that's the manual name, we're just saying hi to it up top instead of doing a whole header line πŸ’…. Buckle up, this one's short and sweet.


🌸 LIBRARY 🌸

import it like this, pick ur fave flavor:

(import (rnrs))                     ;R6RS
(import (rnrs base))                ;R6RS
(import (scheme r5rs))              ;R7RS
(import (scheme base))              ;R7RS

πŸ¦‹ SYNOPSIS πŸ¦‹

(string-append string ...)

πŸ’– DESCRIPTION πŸ’–

Returns a newly allocated string whose characters form the concatenation of the given strings. That's it. That's the whole vibe. You give it strings, it glues them together, it hands you back a fresh new string like a little gift 🎁.

πŸŽ€ IMPLEMENTATION NOTES πŸŽ€

ngl this is the spicy part: some implementations have a single empty string object. Like, one shared empty string that everybody points at. See make-string(3scm) if you wanna dig into that 🧚.

⭐ RETURN VALUES ⭐

Returns a single value β€” a string. One value. Just the one. 🫢

🌈 EXAMPLES 🌈

(string-append "Hello," " " "world!")  =>  "Hello, world!"
(string-append)                        =>  ""

look at that zero-argument glow-up, it gives back "" and honestly? iconic πŸ‘‘

πŸ’œ APPLICATION USAGE πŸ’œ

🚨 bestie listen to me 🚨

Applications should not use this in a loop to accumulate output. I know, I know, it's tempting, it's right there, it's so easy 😭 β€” but don't. Use open-string-output-port(3scm) instead. That's the move. Trust. ✨

πŸ”₯ COMPATIBILITY πŸ”₯

This procedure works the same in all RnRS revisions. No cap. The only difference between implementations is whether the empty string is newly allocated or not (see above, the implementation notes bit πŸ‘€).

πŸ’€ ERRORS πŸ’€

This procedure can raise exceptions with the following condition types:

  • &assertion (R6RS) β€” an argument was outside its domain.
  • R7RS β€” the assertions described above are errors. Implementations may signal an error, extend the procedure's domain of definition to include such arguments, or fail catastrophically. Yeah. catastrophically. No pressure πŸ™ˆ.

πŸ“ SEE ALSO πŸ“

append(3scm), open-string-output-port(3scm)

πŸ‘‘ STANDARDS πŸ‘‘

R4RS, IEEE Scheme, R5RS, R6RS, R7RS β€” she's certified in all of them, an absolute overachiever πŸ’…

🧚 HISTORY 🧚

This procedure first appeared in R2RS. a true legacy queen, she's been slaying since day one ✨

🌸 AUTHORS 🌸

This page is part of the scheme-manpages project. It includes materials from the RnRS documents. More information can be found at https://github.com/schemedoc/manpages/.


πŸ¦‹ and that's the whole page, bestie β€” brought to you by the scheme-manpages crew, dated 2022-05-12, page string-append(3scm). go forth and concatenate responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from