string-append(3scm)
β¨ 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
- nixpkgs unstable: scheme-manpages 0-unstable-2024-02-11
- π the page's license: MIT
- Copyright (c) 2022 Gwen Weinholt
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms